dd option of doing fuzzy equality tests.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27958 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-02-23 08:57:49 +00:00
parent 1db6e01877
commit 1be05b5cd7
3 changed files with 123 additions and 29 deletions

View file

@ -423,41 +423,18 @@ NSIntersectionRect (NSRect aRect, NSRect bRect)
/** Test geometric relationships... **/
GS_GEOM_SCOPE BOOL
/** Returns 'YES' iff aRect's and bRect's origin and size are the same. */
GS_EXPORT BOOL
NSEqualRects(NSRect aRect, NSRect bRect) GS_GEOM_ATTR;
/** Returns 'YES' iff aRect's and bRect's origin and size are the same. */
GS_GEOM_SCOPE BOOL
NSEqualRects(NSRect aRect, NSRect bRect)
{
return ((NSMinX(aRect) == NSMinX(bRect))
&& (NSMinY(aRect) == NSMinY(bRect))
&& (NSWidth(aRect) == NSWidth(bRect))
&& (NSHeight(aRect) == NSHeight(bRect))) ? YES : NO;
}
GS_GEOM_SCOPE BOOL
NSEqualSizes(NSSize aSize, NSSize bSize) GS_GEOM_ATTR;
/** Returns 'YES' iff aSize's and bSize's width and height are the same. */
GS_GEOM_SCOPE BOOL
NSEqualSizes(NSSize aSize, NSSize bSize)
{
return ((aSize.width == bSize.width)
&& (aSize.height == bSize.height)) ? YES : NO;
}
GS_GEOM_SCOPE BOOL
NSEqualPoints(NSPoint aPoint, NSPoint bPoint) GS_GEOM_ATTR;
GS_EXPORT BOOL
NSEqualSizes(NSSize aSize, NSSize bSize) GS_GEOM_ATTR;
/** Returns 'YES' iff aPoint's and bPoint's x- and y-coordinates
* are the same. */
GS_GEOM_SCOPE BOOL
NSEqualPoints(NSPoint aPoint, NSPoint bPoint)
{
return ((aPoint.x == bPoint.x)
&& (aPoint.y == bPoint.y)) ? YES : NO;
}
GS_EXPORT BOOL
NSEqualPoints(NSPoint aPoint, NSPoint bPoint) GS_GEOM_ATTR;
GS_GEOM_SCOPE BOOL
NSMouseInRect(NSPoint aPoint, NSRect aRect, BOOL flipped) GS_GEOM_ATTR;