Skip to main content

Module transform

Module transform 

Source
Expand description

Ported from Arc (MIT) © 2026 Elia Kuratli Hybrid Transform primitives (see docs/porting/P0-DECISIONS.md §2):

  • Translation: exact via Window::with_element_offset or positioning
  • Box scaling: analytical bounds + corner-radius scaling around TransformOrigin
  • SVG/Icon rotation & scale: native GPUI TransformationMatrix

Structs§

Transform2D
Complete 2D transform description for Arc elements.
TransformOrigin
Normalized transform origin ((0.5, 0.5) = center, (0.5, 0.0) = top-center, (0.0, 0.5) = left).

Functions§

scaled_bounds
Scales base by (scale_x, scale_y) keeping the normalized origin point fixed.
scaled_corners
Scales corner radii proportionally to the smaller axis scale factor.
svg_transform_matrix
Builds a native GPUI TransformationMatrix for SVG/icon rotation & scaling.