public class RectF
extends java.lang.Object
| Constructor and Description |
|---|
RectF(float width,
float height) |
RectF(float x,
float y,
float width,
float height) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(RectF rect)
Check if this rectangle contains another rectangle.
|
float |
getArea() |
float |
getHeight() |
float |
getWidth() |
float |
getX() |
float |
getY() |
RectF |
intersection(RectF rect)
Get the intersection of this rectangle with another rectangle.
|
boolean |
intersects(RectF rect)
Check if this rectangle intersects with another rectangle.
|
boolean |
isSquare() |
RectF |
scale(float scale)
Scale the rectangle by the same factor in both directions.
|
RectF |
scale(float scaleX,
float scaleY)
Scale the rectangle by different factors in both directions.
|
RectF |
translate(float x,
float y)
Translate the rectangle by the given values.
|
public static final RectF ZERO
public RectF(float width,
float height)
public RectF(float x,
float y,
float width,
float height)
public float getX()
public float getY()
public float getWidth()
public float getHeight()
public RectF translate(float x, float y)
x - The x translationy - The y translationpublic float getArea()
public boolean isSquare()
public RectF scale(float scale)
scale - The scale factorpublic RectF scale(float scaleX, float scaleY)
scaleX - The scale factor for the x directionscaleY - The scale factor for the y directionpublic boolean intersects(RectF rect)
rect - The other rectanglepublic boolean contains(RectF rect)
rect - The other rectangle