Remove z-axis scaling in extract_text2d_sprite (#9733)

# Objective

In `extract_text2d_sprite` the scaling by the scale factor should be
only be applied to the x and y axes but it's also applied to the z axis.

# Solution

Remove the scaling in the z axis
This commit is contained in:
ickshonpe 2023-09-11 20:12:23 +01:00 committed by GitHub
parent 027ff9f378
commit 9fafceba90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,7 @@ use bevy_ecs::{
reflect::ReflectComponent,
system::{Commands, Local, Query, Res, ResMut},
};
use bevy_math::{Vec2, Vec3};
use bevy_math::Vec2;
use bevy_reflect::Reflect;
use bevy_render::{
prelude::Color,
@ -98,7 +98,7 @@ pub fn extract_text2d_sprite(
.get_single()
.map(|window| window.resolution.scale_factor() as f32)
.unwrap_or(1.0);
let scaling = GlobalTransform::from_scale(Vec3::splat(scale_factor.recip()));
let scaling = GlobalTransform::from_scale(Vec2::splat(scale_factor.recip()).extend(1.));
for (view_visibility, text, text_layout_info, anchor, global_transform) in text2d_query.iter() {
if !view_visibility.get() {