fix zooming causing sub-pixel offset, leading to rendering artifacts
This commit is contained in:
parent
4c4563c326
commit
3e4eb21e5e
1 changed files with 2 additions and 0 deletions
|
@ -230,6 +230,8 @@ impl Editor {
|
||||||
self.zoom += delta;
|
self.zoom += delta;
|
||||||
let tile_size = (16 << self.zoom) as f32;
|
let tile_size = (16 << self.zoom) as f32;
|
||||||
self.view_offset = mouse_pos - tile_pos_of_mouse * tile_size;
|
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) {
|
fn zoom_in(&mut self, d: &RaylibHandle) {
|
||||||
|
|
Loading…
Reference in a new issue