mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Tidyup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3697 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
38ead01a6a
commit
ee65515cf5
2 changed files with 17 additions and 17 deletions
|
@ -273,23 +273,8 @@ NSDivideRect(NSRect aRect,
|
||||||
|
|
||||||
/* Returns a rectangle obtained by expanding ARECT minimally
|
/* Returns a rectangle obtained by expanding ARECT minimally
|
||||||
* so that all four of its defining components are integers. */
|
* so that all four of its defining components are integers. */
|
||||||
GS_GEOM_SCOPE NSRect
|
extern NSRect
|
||||||
NSIntegralRect(NSRect aRect) GS_GEOM_ATTR;
|
NSIntegralRect(NSRect aRect);
|
||||||
|
|
||||||
GS_GEOM_SCOPE NSRect
|
|
||||||
NSIntegralRect(NSRect aRect)
|
|
||||||
{
|
|
||||||
NSRect rect;
|
|
||||||
|
|
||||||
if (NSIsEmptyRect(aRect))
|
|
||||||
return NSMakeRect(0, 0, 0, 0);
|
|
||||||
|
|
||||||
rect.origin.x = floor(aRect.origin.x);
|
|
||||||
rect.origin.y = floor(aRect.origin.y);
|
|
||||||
rect.size.width = ceil(aRect.size.width);
|
|
||||||
rect.size.height = ceil(aRect.size.height);
|
|
||||||
return rect;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Compute a Third Rectangle from Two Rectangles... **/
|
/** Compute a Third Rectangle from Two Rectangles... **/
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,21 @@
|
||||||
/**** Function Implementations ***********************************************/
|
/**** Function Implementations ***********************************************/
|
||||||
/* Most of these are implemented in the header file as inline functkions */
|
/* Most of these are implemented in the header file as inline functkions */
|
||||||
|
|
||||||
|
NSRect
|
||||||
|
NSIntegralRect(NSRect aRect)
|
||||||
|
{
|
||||||
|
NSRect rect;
|
||||||
|
|
||||||
|
if (NSIsEmptyRect(aRect))
|
||||||
|
return NSMakeRect(0, 0, 0, 0);
|
||||||
|
|
||||||
|
rect.origin.x = floor(aRect.origin.x);
|
||||||
|
rect.origin.y = floor(aRect.origin.y);
|
||||||
|
rect.size.width = ceil(aRect.size.width);
|
||||||
|
rect.size.height = ceil(aRect.size.height);
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NSDivideRect(NSRect aRect,
|
NSDivideRect(NSRect aRect,
|
||||||
NSRect *slice,
|
NSRect *slice,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue