public final class CGRect extends Object
Constructor and Description |
---|
CGRect(double x,
double y,
double width,
double height)
Constructs a CGRect object with the specified size and position.
|
Modifier and Type | Method and Description |
---|---|
CGRect |
applyAffineTransform(CGAffineTransform t)
Applies the specified affine transformation to this rectangle.
|
boolean |
containsPoint(CGPoint point)
Returns true if point relative to its parent is inside current CGRect
|
boolean |
equals(Object o) |
double |
getMaxX()
Returns the maximum x value of this rectangle.
|
double |
getMaxY()
Returns the maximum y value of this rectangle.
|
double |
getMinX()
Returns the minimum x value of this rectangle.
|
double |
getMinY()
Returns the minimum y value of this rectangle.
|
CGPoint |
getOrigin() |
CGSize |
getSize() |
int |
hashCode() |
static CGRect |
infinite()
Returns a rectangle that has no defined bounds.
|
CGRect |
intersection(CGRect other)
Returns the intersection of this rectangle with the specified rectangle.
|
boolean |
isEmpty()
Returns a Boolean that shows whether this rectangle is of zero size or
NULL.
|
boolean |
isInfinite()
Returns a Boolean value that shows whether this rectangle is infinite.
|
boolean |
isNull()
Returns a Boolean that shows whether this rectangle is NULL.
|
static CGRect |
Null()
Returns a NULL rectangle.
|
void |
setOrigin(CGPoint origin) |
void |
setSize(CGSize size) |
String |
toString() |
static CGRect |
zero()
Constructs and returns a default CGRect object located at (0,0) with 0
weight and 0 height.
|
public CGRect(double x, double y, double width, double height)
x
- The x-coordinate of the rectangle.y
- The y-coordinate of the rectangle.width
- The width of the rectangle.height
- The height of the rectangle.public CGPoint getOrigin()
public void setOrigin(CGPoint origin)
public CGSize getSize()
public void setSize(CGSize size)
public static CGRect Null()
public static CGRect zero()
public static CGRect infinite()
public CGRect intersection(CGRect other)
other
- The other rectangle that will be intersected with this one.public boolean isNull()
public boolean isEmpty()
public boolean isInfinite()
public double getMinX()
public double getMinY()
public double getMaxX()
public double getMaxY()
public CGRect applyAffineTransform(CGAffineTransform t)
t
- The affine transformation that is applied.CGAffineTransform
public boolean containsPoint(CGPoint point)
point
- point relative to its parentCopyright © 2020. All rights reserved.