|
|
|
|
|
|
100
|
let mut top_left_tile_screen_coord = self.tile_screen_position(&top_left_tile);
|
100
|
let mut top_left_tile_screen_coord = self.tile_screen_position(&top_left_tile);
|
|
101
|
let tile_screen_size = f64::powf(2.0, self.zoom - f64::from(uzoom)) * f64::from(self.tile_size);
|
101
|
let tile_screen_size = f64::powf(2.0, self.zoom - f64::from(uzoom)) * f64::from(self.tile_size);
|
|
102
|
|
102
|
|
|
103
|
- if snap_to_pixel {
|
|
|
|
104
|
- // only snap to pixel if zoom has integral value
|
|
|
|
105
|
- if (self.zoom - (self.zoom + 0.5).floor()).abs() < 1e-10 {
|
|
|
|
106
|
- top_left_tile_screen_coord.snap_to_pixel();
|
|
|
|
107
|
- }
|
|
|
|
|
|
103
|
+ // only snap to pixel grid if zoom has integral value
|
|
|
|
104
|
+ if snap_to_pixel && (self.zoom - (self.zoom + 0.5).floor()).abs() < 1e-10 {
|
|
|
|
105
|
+ top_left_tile_screen_coord.snap_to_pixel();
|
|
108
|
}
|
106
|
}
|
|
109
|
|
107
|
|
|
110
|
let start_tile_x = top_left_tile.x;
|
108
|
let start_tile_x = top_left_tile.x;
|