S or /

SourceClass Rect

from skia import Rect
class Rect:

Properties§

@property def bot(self, /) -> float§
@bot.setter def bot(self, /, value: float) -> None§
Source@property def center(self, /) -> Point2d§
@center.setter def center(self, /, value: Point2d) -> None§
Source@property def height(self, /) -> float§
@height.setter def height(self, /, value: float) -> None§
Source@property def left(self, /) -> float§
@left.setter def left(self, /, value: float) -> None§
@property def pos(self, /) -> Point2d§
Source@property def right(self, /) -> float§
@right.setter def right(self, /, value: float) -> None§
Source@property def size(self, /) -> Point2d§
Source@property def top(self, /) -> float§
@top.setter def top(self, /, value: float) -> None§
Source@property def width(self, /) -> float§
@width.setter def width(self, /, value: float) -> None§
Source@property def x(self, /) -> float§
@x.setter def x(self, /, value: float) -> None§
Source@property def y(self, /) -> float§
@y.setter def y(self, /, value: float) -> None§

Methods§

def clamp(self, /, pt: Point2d) -> Point2d§
def contains(self, /, x_or_pt: Any, y: float |None = None) -> bool§
def copy(self, /) -> Rect§
def distance(self, /, p: Point2d) -> float§
Sourcedef inset(self, /, amount: float) -> Rect§
Sourcedef intersect(self, /, other: Rect) -> Rect§

Returns true if this rectangle intersects r, and sets this rectangle to the intersection. Returns false if this rectangle does not intersect r, and leaves this rectangle unchanged.

Returns false if either r or this rectangle is empty, leaving this rectangle unchanged.

Example (C++): https://fiddle.skia.org/c/@Rect_intersect

Sourcedef intersects(self, /, other: Rect) -> bool§
def zero(self, /) -> bool§