* Headers/Foundation/NSGeometry.h (NSContainsRect): Change behavior

to match Cocoa (sides of rects CAN touch).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20524 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2005-01-06 03:36:43 +00:00
parent a861c353bd
commit 8ea47859cd
2 changed files with 12 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2004-12-30 Adam Fedor <fedor@gnu.org>
* Headers/Foundation/NSGeometry.h (NSContainsRect): Change behavior
to match Cocoa (sides of rects CAN touch).
2004-12-26 Adam Fedor <fedor@gnu.org>
* Add support for systems that support unichar file paths (e.g.

View file

@ -487,15 +487,17 @@ NSContainsRect(NSRect aRect, NSRect bRect) GS_GEOM_ATTR;
/** Returns 'YES' iff aRect totally encloses bRect. NOTE: For
* this to be the case, aRect cannot be empty, nor can any side
* of bRect coincide with any side of aRect. */
* of bRect go beyond any side of aRect. Note that this behavior
* is different than the original OpenStep behavior, where the sides
* of bRect could not touch aRect. */
GS_GEOM_SCOPE BOOL
NSContainsRect(NSRect aRect, NSRect bRect)
{
return (!NSIsEmptyRect(bRect)
&& (NSMinX(aRect) < NSMinX(bRect))
&& (NSMinY(aRect) < NSMinY(bRect))
&& (NSMaxX(aRect) > NSMaxX(bRect))
&& (NSMaxY(aRect) > NSMaxY(bRect))) ? YES : NO;
&& (NSMinX(aRect) <= NSMinX(bRect))
&& (NSMinY(aRect) <= NSMinY(bRect))
&& (NSMaxX(aRect) >= NSMaxX(bRect))
&& (NSMaxY(aRect) >= NSMaxY(bRect))) ? YES : NO;
}
#ifndef STRICT_OPENSTEP