From 324fce116cc8daacf64ba49ecc8a2b833aaf4a40 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Sat, 22 Jun 2019 06:36:40 -0500 Subject: reordered layers, now added rotation of tiles, fixed tileset mapping bug --- src/tileset.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tileset.rs') diff --git a/src/tileset.rs b/src/tileset.rs index 17f4f61..ae65097 100644 --- a/src/tileset.rs +++ b/src/tileset.rs @@ -22,12 +22,12 @@ impl Tileset { let mut tiles = Vec::new(); tiles.push(Rect::zero()); + let w = 1.0 / columns as f32; + let h = 1.0 / rows as f32; for r in 0..rows { for c in 0..columns { let x = c as f32 / columns as f32; let y = r as f32 / rows as f32; - let w = (c as f32 + 1.0) / columns as f32; - let h = (r as f32 + 1.0) / rows as f32; tiles.push(Rect::new(x, y, w, h)); } } -- cgit v1.2.3