Skip to content

Commit

Permalink
Fix animate_scale scaling z value in text2d example (bevyengine#9769)
Browse files Browse the repository at this point in the history
# Objective

I noticed this while testing bevyengine#9733.

It's not causing any problems, but we shouldn't teach users to scale 2d
stuff in z.

## Solution

Only scale in x and y.
  • Loading branch information
rparrett authored and Ray Redondo committed Jan 9, 2024
1 parent c047d69 commit f5843e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/2d/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ fn animate_scale(
// rendered quad, resulting in a pixellated look.
for mut transform in &mut query {
transform.translation = Vec3::new(400.0, 0.0, 0.0);
transform.scale = Vec3::splat((time.elapsed_seconds().sin() + 1.1) * 2.0);

let scale = (time.elapsed_seconds().sin() + 1.1) * 2.0;
transform.scale.x = scale;
transform.scale.y = scale;
}
}

0 comments on commit f5843e7

Please sign in to comment.