FL.Rect
Rect
Rect - base class to represent rectangle
Integer or float values are accepted as coordinates
CONSTRUCTOR: Rect() - generic constructor, creates a Rect with zero coordinates Rect(Rect r) - copy constructor Rect(Point p) - creates rectangle with one corner at (0, 0) and another - at coordinates defined by p Rect(Point p0, Point p1) - creates rectangle defined by the corner points Rect(x0, y0, x1, y1) - creates a rectangle defined by the coordinates of the corner points
ATTRIBUTES: ll (Point) - position of the left/bottom corner ur (Point) - position of the right/top corner x (integer or float) - horizontal position of the left corner y (integer or float) - vertical position of the bottom corner width (integer or float) - width of the rectangle height (integer or float) - height of the rectangle
OPERATIONS: add - Point or Rect must be second operand, rectangle is expanded to include this point or rectange multiply - second operand must be Matrix. Matrix transformation is applied to the rectangle
METHODS Assign(Rect r) | (Point p0, Point p1) | (x0, y0, x1, y1) - assigns new values to a Rect, the same as constructor Shift(Point p) | (x, y) - shifts Rect on a position defined by p or x and y values Transform(Matrix m) - applies Matrix transformation to the Rect (see Matrix().doc) Resize(width, height) - resizes rectangle to new width and height Include(Rect r) | (Point p) | (x, y) - expands rectangle to include new rectangle or point Check(Rect r) - returns True if r overlaps current rectangle Check(Point p) - returns True if p is insude current rectangle Validate() - corrents rectangle's orientation
Native bases: object
Captured native MRO: Rect, object
Native new allocation evidence (not an init overload): (args, *kwargs) Create and return a new object. See help(type) for accurate signature.
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Assign |
function | (self, *args: Any, **kwargs: Any) -> Any |
Assign(Rect r) | (Point p0, Point p1) | (x0, y0, x1, y1) - assigns new values to a Rect, the same as constructor |
Check |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns True if r overlaps current rectangle. |
Include |
function | (self, *args: Any, **kwargs: Any) -> Any |
Include(Rect r) | (Point p) | (x, y) - expands rectangle to include new rectangle or point |
Resize |
function | (self, width: Any, height: Any) -> Any |
Resizes rectangle to new width and height |
Shift |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shift(Point p) | (x, y) - shifts Rect on a position defined by p or x and y values |
Transform |
function | (self, m: Any) -> Any |
|
Validate |
function | (self) -> Any |
Corrents rectangle's orientation |
__init__ |
function | (self, /, *args: Any, **kwargs: Any) -> None |
Initialize self. (shared captured text) |
height |
attribute | Any |
|
ll |
attribute | Any |
|
ur |
attribute | Any |
|
width |
attribute | Any |
|
x |
attribute | Any |
(shared captured text) |
y |
attribute | Any |
(shared captured text) |