diff --git a/src/editor.rs b/src/editor.rs index 27cb053..54d6412 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -230,6 +230,8 @@ impl Editor { self.zoom += delta; let tile_size = (16 << self.zoom) as f32; self.view_offset = mouse_pos - tile_pos_of_mouse * tile_size; + self.view_offset.x = self.view_offset.x.floor(); + self.view_offset.y = self.view_offset.y.floor(); } fn zoom_in(&mut self, d: &RaylibHandle) {