API  0.9.10
CPGeometry.j File Reference

Go to the source code of this file.

Typedefs

typedef CPRectEdge CPMinXEdge = 0
 

Variables

 CPDivideRect = CGRectDivide
 
 CPMakePoint = CGPointMake
 
 CPMakeRect = CGRectMake
 
 CPMakeSize = CGSizeMake
 
 CPMaxXEdge = 2
 
 CPMaxYEdge = 3
 
 CPMinYEdge = 1
 
 CPPointCreateCopy = CGPointMakeCopy
 
 CPPointEqualToPoint = CGPointEqualToPoint
 
 CPPointFromEvent = CGPointFromEvent
 
 CPPointFromString = CGPointFromString
 
 CPPointInRect
 
 CPPointMake = CGPointMake
 
 CPPointMakeZero = CGPointMakeZero
 
 CPRectContainsPoint = CGRectContainsPoint
 
 CPRectContainsRect = CGRectContainsRect
 
 CPRectCreateCopy = CGRectCreateCopy
 
 CPRectEqualToRect = CGRectEqualToRect
 
 CPRectFromString = CGRectFromString
 
 CPRectGetHeight = CGRectGetHeight
 
 CPRectGetMaxX = CGRectGetMaxX
 
 CPRectGetMaxY = CGRectGetMaxY
 
 CPRectGetMidX = CGRectGetMidX
 
 CPRectGetMidY = CGRectGetMidY
 
 CPRectGetMinX = CGRectGetMinX
 
 CPRectGetMinY = CGRectGetMinY
 
 CPRectGetWidth = CGRectGetWidth
 
 CPRectInset = CGRectInset
 
 CPRectIntegral = CGRectIntegral
 
 CPRectIntersection = CGRectIntersection
 
 CPRectIntersectsRect = CGRectIntersectsRect
 
 CPRectIsEmpty = CGRectIsEmpty
 
 CPRectIsNull = CGRectIsNull
 
 CPRectMake = CGRectMake
 
 CPRectMakeZero = CGRectMakeZero
 
 CPRectOffset = CGRectOffset
 
 CPRectStandardize = CGRectStandardize
 
 CPRectUnion = CGRectUnion
 
 CPSizeCreateCopy = CGSizeCreateCopy
 
 CPSizeEqualToSize = CGSizeEqualToSize
 
 CPSizeFromString = CGSizeFromString
 
 CPSizeMake = CGSizeMake
 
 CPSizeMakeZero = CGSizeMakeZero
 
 CPStringFromPoint = CGStringFromPoint
 
 CPStringFromRect = CGStringFromRect
 
 CPStringFromSize = CGStringFromSize
 

Typedef Documentation

◆ CPMinXEdge

typedef CPRectEdge CPMinXEdge = 0

Definition at line 25 of file CPGeometry.j.

Variable Documentation

◆ CPDivideRect

CPDivideRect = CGRectDivide

Creates two rectangles – slice and rem – from inRect, by dividing inRect with a line that's parallel to the side of inRect specified by edge. The size of slice is determined by amount, which specifies the distance from edge.

slice and rem must not be NULL.

CGRect

Definition at line 306 of file CPGeometry.j.

◆ CPMakePoint

CPMakePoint = CGPointMake

Makes a CGPoint object out of two numbers provided as arguments CGPoint

Parameters
xthe x-coordinate of the CGPoint
ythe y-coordinate of the CGPoint
Returns
CGPoint a CGPoint with an X and Y coordinate equal to the function arguments

Definition at line 37 of file CPGeometry.j.

◆ CPMakeRect

CPMakeRect = CGRectMake

Returns a CGRect made of the specified arguments CGRect

Parameters
xthe x-coordinate of the rectangle's origin
ythe y-coordinate of the rectangle's origin
widththe width of the new rectangle
heightthe height of the new rectangle
Returns
CGRect the new rectangle

Definition at line 57 of file CPGeometry.j.

◆ CPMakeSize

CPMakeSize = CGSizeMake

Creates and returns a new CGSize object from the provided dimensions. CGSize

Parameters
widththe width for the new CGSize
heightthe height for the new CGSize
Returns
CGSize the new CGSize

Definition at line 46 of file CPGeometry.j.

◆ CPMaxXEdge

CPMaxXEdge = 2

Definition at line 27 of file CPGeometry.j.

◆ CPMaxYEdge

CPMaxYEdge = 3

Definition at line 28 of file CPGeometry.j.

◆ CPMinYEdge

CPMinYEdge = 1

Definition at line 26 of file CPGeometry.j.

◆ CPPointCreateCopy

CPPointCreateCopy = CGPointMakeCopy

Creates a copy of a specified point and returns the copy CGPoint

Parameters
thepoint to be copied
Returns
CGPoint the copy of the provided CGPoint

Definition at line 65 of file CPGeometry.j.

◆ CPPointEqualToPoint

CPPointEqualToPoint = CGPointEqualToPoint

Tests whether the two CGPoints are equal to each other by comparing their x and y members.

Parameters
lhsPointthe first CGPoint to check
rhsPointthe second CGPoint to check
Returns
BOOL YES if the two points have the same x's, and the same y's.

Definition at line 75 of file CPGeometry.j.

◆ CPPointFromEvent

CPPointFromEvent = CGPointFromEvent

CGPoint

Parameters
anEvent
Returns
CGPoint

Definition at line 370 of file CPGeometry.j.

◆ CPPointFromString

CPPointFromString = CGPointFromString

Returns a CGPoint from a string with a comma separated pair of integers. CGPoint

Parameters
aStringa string containing two comma separated integers
Returns
CGPoint the point object created from the string

Definition at line 347 of file CPGeometry.j.

◆ CPPointInRect

CPPointInRect
Initial value:
= function(aPoint, aRect)
{
return CGRectContainsPoint(aRect, aPoint)
}

Tests whether the CGPoint is contained by the CGRect. CGPoint

Parameters
aPointthe CGPoint to check
aRectthe CGRect to check
Returns
BOOL YES if the rect contains the point.

Definition at line 84 of file CPGeometry.j.

◆ CPPointMake

CPPointMake = CGPointMake

Makes a CGPoint object out of two numbers provided as arguments CGPoint

Parameters
xthe x-coordinate of the CGPoint
ythe y-coordinate of the CGPoint
Returns
CGPoint a CGPoint with an X and Y coordinate equal to the function arguments

Definition at line 133 of file CPGeometry.j.

◆ CPPointMakeZero

CPPointMakeZero = CGPointMakeZero

Returns a point located at (0, 0). CGPoint

Returns
CGPoint a point located at (0, 0)

Definition at line 391 of file CPGeometry.j.

◆ CPRectContainsPoint

CPRectContainsPoint = CGRectContainsPoint

Returns YES if the CGRect, aRect, contains the CGPoint, aPoint.

Parameters
aRectthe rectangle to test with
aPointthe point to test with CGRect
Returns
BOOL YES if the rectangle contains the point, NO otherwise.

Definition at line 222 of file CPGeometry.j.

◆ CPRectContainsRect

CPRectContainsRect = CGRectContainsRect

Returns a BOOL indicating whether CGRect possibleOuter contains CGRect possibleInner. CGRect

Parameters
possibleOuterthe CGRect to test if possibleInner is inside of
possibleInnerthe CGRect to test if it fits inside possibleOuter.
Returns
BOOL YES if possibleInner fits inside possibleOuter.

Definition at line 115 of file CPGeometry.j.

◆ CPRectCreateCopy

CPRectCreateCopy = CGRectCreateCopy

Creates a copy of the provided rectangle CGRect

Parameters
aRectthe CGRect that will be copied
Returns
CGRect the rectangle copy

Definition at line 158 of file CPGeometry.j.

◆ CPRectEqualToRect

CPRectEqualToRect = CGRectEqualToRect

Test whether the two CGRects have the same origin and size CGRect

Parameters
lhsRectthe first CGRect to compare
rhsRectthe second CGRect to compare
Returns
BOOL YES if the two rectangles have the same origin and size. NO, otherwise.

Definition at line 96 of file CPGeometry.j.

◆ CPRectFromString

CPRectFromString = CGRectFromString

Returns a CGRect created from a string. CGRect

Parameters
aStringa string in the form generated by CPStringFromRect
Returns
CGRect the rectangle created from the string

Definition at line 363 of file CPGeometry.j.

◆ CPRectGetHeight

CPRectGetHeight = CGRectGetHeight

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 229 of file CPGeometry.j.

◆ CPRectGetMaxX

CPRectGetMaxX = CGRectGetMaxX

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 236 of file CPGeometry.j.

◆ CPRectGetMaxY

CPRectGetMaxY = CGRectGetMaxY

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 243 of file CPGeometry.j.

◆ CPRectGetMidX

CPRectGetMidX = CGRectGetMidX

CGRect

Parameters
aRecta CGRect
Returns
float

Definition at line 250 of file CPGeometry.j.

◆ CPRectGetMidY

CPRectGetMidY = CGRectGetMidY

CGRect

Parameters
aRecta CGRect
Returns
float

Definition at line 257 of file CPGeometry.j.

◆ CPRectGetMinX

CPRectGetMinX = CGRectGetMinX

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 264 of file CPGeometry.j.

◆ CPRectGetMinY

CPRectGetMinY = CGRectGetMinY

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 271 of file CPGeometry.j.

◆ CPRectGetWidth

CPRectGetWidth = CGRectGetWidth

CGRect

Parameters
aRecta CGRect
Returns
int

Definition at line 278 of file CPGeometry.j.

◆ CPRectInset

CPRectInset = CGRectInset

Makes a CGRect with an origin and size equal to aRect less the dX/dY insets specified.

Parameters
dXthe size of the inset in the x-axis
dYthe size of the inset in the y-axis CGRect
Returns
CGRect a rectangle like aRect with an inset

Definition at line 142 of file CPGeometry.j.

◆ CPRectIntegral

CPRectIntegral = CGRectIntegral

CGRect

Returns
void
Deprecated:

Definition at line 150 of file CPGeometry.j.

◆ CPRectIntersection

CPRectIntersection = CGRectIntersection

Returns the intersection of the two provided rectangles as a new rectangle CGRect

Parameters
lhsRectthe first rectangle used for calculation
rhsRectthe second rectangle used for calculation
Returns
CGRect the intersection of the two rectangles

Definition at line 124 of file CPGeometry.j.

◆ CPRectIntersectsRect

CPRectIntersectsRect = CGRectIntersectsRect

Returns YES if the two rectangles intersect CGRect

Parameters
lhsRectthe first CGRect
rhsRectthe second CGRect
Returns
BOOL YES if the two rectangles have any common spaces, and NO, otherwise.

Definition at line 287 of file CPGeometry.j.

◆ CPRectIsEmpty

CPRectIsEmpty = CGRectIsEmpty

Returns YES if the CGRect has no area. The test is performed by checking if the width and height are both zero. CGRect

Parameters
aRectthe CGRect to test
Returns
BOOL YES if the CGRect has no area, and NO, otherwise.

Definition at line 105 of file CPGeometry.j.

◆ CPRectIsNull

CPRectIsNull = CGRectIsNull

Returns YES if the CGRect has no area. The test is performed by checking if the width and height are both zero. CGRect

Returns
BOOL YES if the CGRect has no area, and NO, otherwise.

Definition at line 295 of file CPGeometry.j.

◆ CPRectMake

CPRectMake = CGRectMake

Returns a CGRect made of the specified arguments CGRect

Parameters
xthe x-coordinate of the rectangle's origin
ythe y-coordinate of the rectangle's origin
widththe width of the new rectangle
heightthe height of the new rectangle
Returns
CGRect the new rectangle

Definition at line 169 of file CPGeometry.j.

◆ CPRectMakeZero

CPRectMakeZero = CGRectMakeZero

Returns a rectangle at origin (0,0) and size of (0,0). CGRect

Returns
CGRect a zeroed out CGRect

Definition at line 384 of file CPGeometry.j.

◆ CPRectOffset

CPRectOffset = CGRectOffset

Creates a new rectangle with its origin offset by dX and dY. CGRect

Parameters
aRectthe rectangle to copy the origin and size from
dXthe amount added to the x-size of the new rectangle
dYthe amount added to the y-size of the new rectangle
Returns
CGRect the new rectangle with modified size

Definition at line 179 of file CPGeometry.j.

◆ CPRectStandardize

CPRectStandardize = CGRectStandardize

CGRect

Parameters
aRecta CGRect
Returns
CGRect

Definition at line 186 of file CPGeometry.j.

◆ CPRectUnion

CPRectUnion = CGRectUnion

Returns the smallest rectangle that can contain the two argument CGRects. CGRect

Parameters
lhsRectthe first CGRect to use for the union calculation
rhsRectthe second CGRect to use for the union calculation
Returns
CGRect the union rectangle

Definition at line 195 of file CPGeometry.j.

◆ CPSizeCreateCopy

CPSizeCreateCopy = CGSizeCreateCopy

Creates and returns a copy of the provided CGSize CGSize

Parameters
aSizethe CGSize to copy
Returns
CGSize the copy of the CGSize

Definition at line 203 of file CPGeometry.j.

◆ CPSizeEqualToSize

CPSizeEqualToSize = CGSizeEqualToSize

Returns YES if the two CGSizes are identical. CGSize

Parameters
lhsSizethe first CGSize to compare
rhsSizethe second CGSize to compare
Returns
BOOL YES if the two sizes are identical. NO, otherwise.

Definition at line 315 of file CPGeometry.j.

◆ CPSizeFromString

CPSizeFromString = CGSizeFromString

Returns a CGSize from a string containing a pair of comma separated integers. CGSize

Parameters
aStringa string containing two comma separated integers
Returns
CGSize the size object created from the string

Definition at line 355 of file CPGeometry.j.

◆ CPSizeMake

CPSizeMake = CGSizeMake

Creates and returns a new CGSize object from the provided dimensions. CGSize

Parameters
widththe width for the new CGSize
heightthe height for the new CGSize
Returns
CGSize the new CGSize

Definition at line 212 of file CPGeometry.j.

◆ CPSizeMakeZero

CPSizeMakeZero = CGSizeMakeZero

Returns a zero sized CGSize. CGSize

Returns
CGSize a size object with zeros for width and height

Definition at line 377 of file CPGeometry.j.

◆ CPStringFromPoint

CPStringFromPoint = CGStringFromPoint

Returns a human readable string of the provided CGPoint. CGPoint

Parameters
aPointthe point to represent
Returns
CGPoint a string representation of the CGPoint

Definition at line 323 of file CPGeometry.j.

◆ CPStringFromRect

CPStringFromRect = CGStringFromRect

Returns a human readable string of the provided CGRect. CGRect

Parameters
aRectthe rectangle to represent
Returns
CGString the string representation of the rectangle

Definition at line 339 of file CPGeometry.j.

◆ CPStringFromSize

CPStringFromSize = CGStringFromSize

Returns a human readable string of the provided CGSize. CGSize

Parameters
aSizethe size to represent
Returns
CGSize a string representation of the CGSize

Definition at line 331 of file CPGeometry.j.