FL.objects.Rect.Rect
- class FL.objects.Rect.Rect(r_or_p0_or_x0: Rect | Point | float | None = None, p1_or_x0: Point | float | None = None, x1: float | None = None, y1: float | None = None)
Bases:
CopyableRect - base class to represent rectangle
Integer or float values are accepted as coordinates
- __init__(r_or_p0_or_x0: Rect | Point | float | None = None, p1_or_x0: Point | float | None = None, x1: float | None = None, y1: float | None = None) None
- 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
- Parameters:
Methods
Assign([r_or_p0_or_x0, p1_or_x0, x1, y1])Assigns new values to a Rect, the same as constructor
Check(r_or_p)Include(r_or_p_or_x[, y])Resize()Shift(p_or_x[, y])Transform(m)Validate()Corrects rectangle's orientation
__init__([r_or_p0_or_x0, p1_or_x0, x1, y1])Rect()
Attributes
heightposition of the left/bottom corner
position of the right/top corner
widthxy