diff options
Diffstat (limited to 'light-client')
-rw-r--r-- | light-client/src/render/sprite.rs | 6 | ||||
-rw-r--r-- | light-client/src/tilemap.rs | 2 |
2 files changed, 4 insertions, 4 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, } diff --git a/light-client/src/tilemap.rs b/light-client/src/tilemap.rs index cf8c5eef..e7341efa 100644 --- a/light-client/src/tilemap.rs +++ b/light-client/src/tilemap.rs @@ -77,7 +77,7 @@ impl Tilemap { let src = self.tile_srcs[tile.0][idx]; self.tiles - .insert(pos, Sprite::new_tile(src).at(pos.as_vec2() + 0.5)); + .insert(pos, Sprite::new_tile(src).at(pos.as_vec2())); } pub fn draw(&self, ctx: &mut SpriteRenderer) { |