Rectify extension
Methods
-
adjust(double dx1, double dy1, double dx2, double dy2)
→ Rect
-
Returns a new rectangle with
dx1
, dy1
, dx2
and dy2
added
respectively to the existing coordinates of this rectangle.
-
intersects(Rect other)
→ bool
-
Returns
true
if this rectangle intersects with the given rectangle
(i.e. there is a non-empty area of overlap between them), otherwise
returns false
.
-
moveBottom(double bottom)
→ Rect
-
Moves the rectangle vertically, leaving the rectangle's bottom edge at
the given
y
coordinate. The rectangle's size is unchanged.
-
moveBottomLeft(Offset bottomLeft)
→ Rect
-
Moves the rectangle, leaving the bottom-left corner at the given position.
The rectangle's size is unchanged.
-
moveBottomRight(Offset bottomRight)
→ Rect
-
Moves the rectangle, leaving the bottom-right corner at the given
position. The rectangle's size is unchanged.
-
moveCenter(Offset center)
→ Rect
-
Moves the rectangle, leaving the center point at the given position. The
rectangle's size is unchanged.
-
moveLeft(double left)
→ Rect
-
Moves the rectangle horizontally, leaving the rectangle's left edge at the
given position. The rectangle's size is unchanged.
-
moveRight(double right)
→ Rect
-
Moves the rectangle horizontally, leaving the rectangle's right edge at
the given position. The rectangle's size is unchanged.
-
moveTop(double top)
→ Rect
-
Moves the rectangle vertically, leaving the rectangle's top line at the
given position. The rectangle's size is unchanged.
-
moveTopLeft(Offset topLeft)
→ Rect
-
Moves the rectangle, leaving the top-left corner at the given position.
The rectangle's size is unchanged.
-
moveTopRight(Offset topRight)
→ Rect
-
Moves the rectangle, leaving the top-right corner at the given position.
The rectangle's size is unchanged.
-
normalize()
→ Rect
-
Returns a normalized rectangle; i.e., a rectangle that has a non-negative
width and height.
-
setBottom(double bottom)
→ Rect
-
Sets the bottom edge of the rectangle to the given position. May change
the height, but will never change the top edge of the rectangle.
-
setBottomLeft(Offset bottomLeft)
→ Rect
-
Set the bottom-left corner of the rectangle to the given position. May
change the size, but will never change the top-right corner of the
rectangle.
-
setBottomRight(Offset bottomRight)
→ Rect
-
Set the bottom-right corner of the rectangle to the given position. May
change the size, but will never change the top-left corner of the
rectangle.
-
setHeight(double height)
→ Rect
-
Sets the height of the rectangle to the given height. The bottom edge is
changed, but not the top one.
-
setLeft(double left)
→ Rect
-
Sets the left edge of the rectangle to the given position. May change the
width, but will never change the right edge of the rectangle.
-
setRight(double right)
→ Rect
-
Sets the right edge of the rectangle to the given x coordinate. May change
the width, but will never change the left edge of the rectangle.
-
setSize(Size size)
→ Rect
-
Sets the size of the rectangle to the given size. The top-left corner is
not moved.
-
setTop(double top)
→ Rect
-
Sets the top edge of the rectangle to the given position. May change the
height, but will never change the bottom edge of the rectangle.
-
setTopLeft(Offset topLeft)
→ Rect
-
Set the top-left corner of the rectangle to the given position. May change
the size, but will never change the bottom-right corner of the rectangle.
-
setTopRight(Offset topRight)
→ Rect
-
Set the top-right corner of the rectangle to the given position. May
change the size, but will never change the bottom-left corner of the
rectangle.
-
setWidth(double width)
→ Rect
-
Sets the width of the rectangle to the given width. The right edge is
changed, but not the left one.
-
transpose()
→ Rect
-
Returns a new rectangle that has its width and height exchanged.
-
unite(Rect other)
→ Rect
-
Returns the bounding rectangle of this rectangle and the given rectangle.