Browse Source

Fix clippy warning

Johannes Hofmann 7 years ago
parent
commit
d52ac36ff6
1 changed files with 3 additions and 5 deletions
  1. 3
    5
      src/map_view.rs

+ 3
- 5
src/map_view.rs View File

@@ -100,11 +100,9 @@ impl MapView {
100 100
         let mut top_left_tile_screen_coord = self.tile_screen_position(&top_left_tile);
101 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 108
         let start_tile_x = top_left_tile.x;