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).

Enums§

RevealMask
空间揭幕的裁剪方式。只负责几何,不负责主题或场景快照。

Functions§

reveal_regions
以横向扫描带描述圆形边界;矩形过渡只产生一个裁剪区。 band_height 由宿主按像素密度提供,不在运动层硬编码绘制质量。
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.