Skip to content

Commit

Permalink
Fixed ui slice being flipped
Browse files Browse the repository at this point in the history
  • Loading branch information
ManevilleF committed Feb 7, 2024
1 parent 96e85b9 commit 82163e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/bevy_ui/src/texture_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ impl ComputedTextureSlices {
camera_entity: Entity,
) -> impl ExactSizeIterator<Item = ExtractedUiNode> + 'a {
self.slices.iter().map(move |slice| {
let transform =
transform.mul_transform(Transform::from_translation(slice.offset.extend(0.0)));
let transform = transform.mul_transform(Transform::from_xyz(
slice.offset.x,
slice.offset.y * -1.0,
0.0,
));
let scale = slice.draw_size / slice.texture_rect.size();
let mut rect = slice.texture_rect;
rect.min *= scale;
Expand All @@ -56,7 +59,7 @@ impl ComputedTextureSlices {
// TODO: support flip
flip_x: false,
// TODO: support flip
flip_y: true,
flip_y: false,
image: image.texture.id(),
atlas_size,
clip: clip.map(|clip| clip.clip),
Expand Down

0 comments on commit 82163e4

Please sign in to comment.