qmathe@club-internet.fr)Geometry utility functions and constants.
Copyright: (C) 2008 Quentin Mathe
The null point which is not equal to NSZeroPoint. It can be returned when a point value is undefined and is a nil-like marker for NSPoint primitive.
The null rectangle which is not equal to NSZeroRect. It can be returned when a rect value is undefined and is a nil-like marker for NSRect primitive.
The null size which is not equal to NSZeroSize. It can be returned when a size value is undefined and is a nil-like marker for NSSize primitive.
Returns a rect that uses aSize as its size and centered inside the given rect.
The returned rect is expressed relative the given rect
parent coordinate space.
To get a rect
expressed relative the the given rect itself,
pass a rect with a zero origin:
NSRect inRect = NSMakeRect(40, 50, 100,
200); NSRect centeredRectSize = NSMakeSize(50,
100); NSRect rect =
ETCenteredRect(centeredRectSize,
ETMakeRect(NSZeroPoint,
inRect.size));
The resulting rect is equal to {25, 50, 50, 100}.
The returned rect origin is valid whether or not your coordinate space is flipped.
Returns whether the given point is equal to ETNullPoint.
Returns whether rect is equal to ETNullRect.
Returns a rect with the given origin and size.
Returns whether rect contains a point expressed in coordinates relative to the rect origin.
Returns a rect with a width and height multiplied by the given factor and by shifting the origin to retain the original rect center location.
Returns a size with a width and height multiplied by the given factor.
Returns a rect that uses aSize scaled based on the content aspect rule and then centered inside the given rect.
The returned rect is expressed relative the given rect
parent coordinate space.
To get a rect
expressed relative the the given rect itself, see
ETCenteredRect()
.
The returned rect origin is valid whether or not your coordinate space is flipped.
Returns whether the sizes are equal or precisely almost equal. To be considered equal, the size variation must remain smaller than FLT_EPSILON. On Mac OS X, NSEqualsSize tests exact equality unlike GNUstep implementation.
Returns a rect with a positive width and height by shifting the origin as needed.
Returns a new point by summing the x and y coordinates of two points.
Returns a new point by summing the point x and y coordinates with the size width and height.
Returns an union rect computed by iterating over itemArray and unionning the rects returned by the objects which must all respond to rectSelector.
itemArray must only contain objects of the same type.
A zero rect is returned when itemArray is empty.