MutableRect class

A mutable rectangle with the semantics of android.graphics.RectF.

Renderers reuse rectangle fields across frames, so unlike ui.Rect the edges can be changed in place. Use toRect and setFromRect at the boundary with dart:ui.

Constructors

MutableRect([double left = 0, double top = 0, double right = 0, double bottom = 0])
Creates a rectangle with the given edges; with no arguments it is empty at the origin, like RectF().

Properties

bottom ↔ double
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
True if the rectangle has no area: left >= right or top >= bottom.
no setter
left ↔ double
getter/setter pair
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
top ↔ double
getter/setter pair

Methods

centerX() → double
The horizontal center, (left + right) / 2.
centerY() → double
The vertical center, (top + bottom) / 2.
contains(double x, double y) → bool
True if the rectangle is not empty and (x, y) lies inside it; the left and top edges are inside, the right and bottom edges are outside.
height() → double
The height, bottom - top.
inset(double dx, double dy) → void
Moves the left and right edges in by dx and the top and bottom edges in by dy; negative values move them out.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(double dx, double dy) → void
Moves the rectangle by dx horizontally and dy vertically.
set(double left, double top, double right, double bottom) → void
Sets all four edges.
setFrom(MutableRect src) → void
Copies the edges of src (Android set(RectF src)).
setFromRect(Rect src) → void
Copies the edges of src.
toRect() → Rect
Returns an immutable copy as a ui.Rect.
toString() → String
A string representation of this object.
inherited
width() → double
The width, right - left.

Operators

operator ==(Object other) → bool
The equality operator.
inherited