SourceClass RoundRect
from skia import RoundRectclass RoundRect:Properties§
@property
def bottom_left_radii(self, /) -> tuple[float, float]§
@property
def bottom_right_radii(self, /) -> tuple[float, float]§
Source@property
def height(self, /) -> float§
Returns the span on the y-axis. This does not check if the result fits in a 32-bit float; the result may be infinity.
Source@property
def rect(self, /) -> tuple[float, float, float, float]§
Returns bounds. Bounds may have zero width or zero height. Bounds right is greater than or
equal to left; bounds bottom is greater than or equal to top. Result is identical to
skia.RoundRect.bounds().
@property
def top_left_radii(self, /) -> tuple[float, float]§
@property
def top_right_radii(self, /) -> tuple[float, float]§
Source@property
def width(self, /) -> float§
Returns the span on the x-axis. This does not check if the result fits in a 32-bit float; the result may be infinity.
Methods§
def contains_rect(self, /, rect: tuple[float, float, float, float]) -> bool§
def copy(self, /) -> RoundRect§
@classmethod
def empty(cls, /) -> RoundRect§
@classmethod
def from_rect(cls, /, rect: Any, x: float |None = None, y: float |None = None, radii: tuple[float, float] |None = None) -> RoundRect§
Sourcedef inset(self, /, dx: float, dy: float) -> RoundRect§
Insets bounds by delta, and adjusts radii by delta. delta may be positive, negative,
or zero.
If either corner radius is zero, the corner has no curvature and is unchanged. Otherwise, if
the adjusted radius becomes negative, pins the radius to zero. If delta.x exceeds half the
bounds width, the bounds left and right are set to the bounds x-axis center. If delta.y
exceeds half the bounds height, the bounds top and bottom are set to the bounds y-axis
center.
If delta causes the bounds to become infinite, the bounds is zeroed.
Example (C++): https://fiddle.skia.org/c/@RRect_inset
@classmethod
def nine_patch(cls, /, left: float, top: float, right: float, bottom: float) -> RoundRect§
Sourcedef offset(self, /, dx: float, dy: float) -> RoundRect§
Translates this rounded rectangle by delta.
Sourcedef outset(self, /, dx: float, dy: float) -> RoundRect§
Outsets bounds by delta, and adjusts radii by delta. delta may be positive, negative,
or zero.
If either corner radius is zero, the corner has no curvature and is unchanged. Otherwise, if
the adjusted radius becomes negative, pins the radius to zero. If delta.x exceeds half the
bounds width, the bounds left and right are set to the bounds x-axis center. If delta.y
exceeds half the bounds height, the bounds top and bottom are set to the bounds y-axis
center.
If delta causes the bounds to become infinite, the bounds is zeroed.