We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fe2f1f commit 509ddb3Copy full SHA for 509ddb3
src/window/mouse_manager.rs
@@ -109,15 +109,13 @@ impl MouseManager {
109
let relative_position = (self.window_position - window_details.region.min).to_point();
110
(relative_position / *editor_state.grid_scale)
111
.floor()
112
+ .max((0.0, 0.0).into())
113
.try_cast()
114
.unwrap()
- .clamp(
115
- (0, 0).into(),
116
- Point2::new(
117
- window_details.grid_size.width.max(1) - 1,
118
- window_details.grid_size.height.max(1) - 1,
119
- ),
120
- )
+ .min(Point2::new(
+ window_details.grid_size.width.max(1) - 1,
+ window_details.grid_size.height.max(1) - 1,
+ ))
121
}
122
123
fn handle_pointer_motion(&mut self, position: PixelPos<f32>, editor_state: &EditorState) {
0 commit comments