Skip to content

Commit 977a6e7

Browse files
committed
adds some helper comments
1 parent 29a54c0 commit 977a6e7

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

src/integrations/lottie/render.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ impl PrepareRenderInstance for ExtractedLottieAsset {
173173
// | cos(θ) -sin(θ) translate_x |
174174
// | sin(θ) cos(θ) translate_y |
175175
// | sheer_z sheer_z scale_z |
176+
//
177+
// The order of operations is important, as it affects the final transformation matrix.
178+
//
179+
// Order of operations:
180+
// 1. Scale
181+
// 2. Rotate
182+
// 3. Translate
176183
let transform: [f64; 6] = if let Some(node) = self.ui_node {
177184
local_center_matrix.w_axis.y *= -1.0;
178185
let mut model_matrix = world_transform.compute_matrix();

src/integrations/svg/render.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ impl PrepareRenderInstance for ExtractedVelloSvg {
165165
// | cos(θ) -sin(θ) translate_x |
166166
// | sin(θ) cos(θ) translate_y |
167167
// | sheer_z sheer_z scale_z |
168+
//
169+
// The order of operations is important, as it affects the final transformation matrix.
170+
//
171+
// Order of operations:
172+
// 1. Scale
173+
// 2. Rotate
174+
// 3. Translate
168175
let transform: [f64; 6] = if let Some(node) = self.ui_node {
169176
local_center_matrix.w_axis.y *= -1.0;
170177
let mut model_mat = world_transform.compute_matrix();

src/integrations/text/render.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ pub fn prepare_text_affines(
140140
// | cos(θ) -sin(θ) translate_x |
141141
// | sin(θ) cos(θ) translate_y |
142142
// | sheer_z sheer_z scale_z |
143+
//
144+
// The order of operations is important, as it affects the final transformation matrix.
145+
//
146+
// Order of operations:
147+
// 1. Scale
148+
// 2. Rotate
149+
// 3. Translate
143150
let transform: [f64; 6] =
144151
if render_entity.ui_node.is_some() || render_entity.screen_space.is_some() {
145152
let mut model_matrix = world_transform.compute_matrix();

src/render/prepare.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ pub fn prepare_scene_affines(
6565
// | cos(θ) -sin(θ) translate_x |
6666
// | sin(θ) cos(θ) translate_y |
6767
// | sheer_z sheer_z scale_z |
68+
//
69+
// The order of operations is important, as it affects the final transformation matrix.
70+
//
71+
// Order of operations:
72+
// 1. Scale
73+
// 2. Rotate
74+
// 3. Translate
6875
let transform: [f64; 6] = if let Some(node) = render_entity.ui_node {
6976
let mut model_matrix = world_transform.compute_matrix();
7077
let Vec2 { x, y } = node.size();

0 commit comments

Comments
 (0)