S or /

SourceClass TSTransform

from egui import TSTransform
class TSTransform:

Linearly transforms positions via a translation, then a scaling.

TSTransform first scales points with the scaling origin at 0, 0 (the top left corner), then translates them.

Properties§

@property def scaling(self, /) -> float§
@scaling.setter def scaling(self, /, scaling: float) -> None§
@property def translation(self, /) -> Vec2§
@translation.setter def translation(self, /, translation: Vec2) -> None§

Methods§

Source@staticmethod def from_scaling(scaling: float) -> TSTransform§
Source@staticmethod def from_translation(translation: Vec2) -> TSTransform§
Sourcedef inverse(self, /) -> TSTransform§

Inverts the transform.

Sourcedef is_valid(self, /) -> bool§

Is this a valid, invertible transform?

Sourcedef mul_pos(self, /, pos: Pos2) -> Pos2§

Transforms the given coordinate.

Sourcedef mul_rect(self, /, rect: Rect) -> Rect§

Transforms the given rectangle.