diff options
author | tom barrett <spalf0@gmail.com> | 2019-06-22 06:36:40 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-06-22 06:36:40 -0500 |
commit | 324fce116cc8daacf64ba49ecc8a2b833aaf4a40 (patch) | |
tree | a1f9fe8b33311d1207408d158b33a346e29d84b2 /src/tileset.rs | |
parent | c182662e06b3134e51db938371a0b313d2948d7c (diff) |
reordered layers, now added rotation of tiles, fixed tileset mapping bug
Diffstat (limited to 'src/tileset.rs')
-rw-r--r-- | src/tileset.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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)); } } |