fix right edge grid rendering

This commit is contained in:
Crispy 2025-04-20 20:45:57 +02:00
parent 80ab3b676e
commit 2c7e844d00
4 changed files with 10 additions and 8 deletions

View file

@ -289,12 +289,12 @@ impl Grid {
let tile_size = (TILE_TEXTURE_SIZE * scale) as i32;
let start_x = (-offset.x as i32) / tile_size - 1;
let tile_width = d.get_screen_width() / tile_size + 2;
let tiles_width = d.get_screen_width() / tile_size + 3;
let start_y = (-offset.y as i32) / tile_size - 1;
let tile_height = d.get_screen_height() / tile_size + 2;
let tiles_height = d.get_screen_height() / tile_size + 3;
for x in start_x..(start_x + tile_width) {
for y in start_y..(start_y + tile_height) {
for x in start_x..(start_x + tiles_width) {
for y in start_y..(start_y + tiles_height) {
let px = x * tile_size + offset.x as i32;
let py = y * tile_size + offset.y as i32;
if let Some(tile) = self.get((x, y).into()) {