diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-16 18:32:14 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-16 18:32:14 +0200 |
commit | 4064c56783bd78b96b0e79d5a7b15b1fb0d8edad (patch) | |
tree | fb595c112c60886732b459ba5e2453440379cc50 /light-client/src/render/sprite.rs | |
parent | 511199443a419f549aeb500d7b013baef10152de (diff) | |
download | hurrycurry-4064c56783bd78b96b0e79d5a7b15b1fb0d8edad.tar hurrycurry-4064c56783bd78b96b0e79d5a7b15b1fb0d8edad.tar.bz2 hurrycurry-4064c56783bd78b96b0e79d5a7b15b1fb0d8edad.tar.zst |
fix z-order problems partially
Diffstat (limited to 'light-client/src/render/sprite.rs')
-rw-r--r-- | light-client/src/render/sprite.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/light-client/src/render/sprite.rs b/light-client/src/render/sprite.rs index 13ede525..c19f8392 100644 --- a/light-client/src/render/sprite.rs +++ b/light-client/src/render/sprite.rs @@ -10,13 +10,13 @@ pub struct Sprite { impl Sprite { pub fn new(src: Rect, anchor: Vec2, elevation: f32) -> Self { let relative_dst = FRect::new( - -anchor.x - (src.w as f32) / 32. / 2., - -anchor.y - (src.h as f32) / 24., + anchor.x - (src.w as f32) / 32. / 2., + anchor.y - (src.h as f32) / 24., (src.w as f32) / 32., (src.h as f32) / 24., ); Self { - z_offset: -relative_dst.h + anchor.y - elevation, + z_offset: elevation, src, relative_dst, } |