(coord: Coord, tolerance: f64)
| 103 | } |
| 104 | |
| 105 | fn snap_coord_grid(coord: Coord, tolerance: f64) -> Coord { |
| 106 | Coord { |
| 107 | x: snap_f64_grid(coord.x, tolerance), |
| 108 | y: snap_f64_grid(coord.y, tolerance), |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | fn snap_f64_grid(value: f64, tolerance: f64) -> f64 { |
| 113 | // This was waaaay harder than I expected :( |