@@ -63,7 +63,7 @@ struct TouchTrace {
63
63
64
64
pub struct MouseManager {
65
65
drag_details : Option < DragDetails > ,
66
- grid_position : GridPos < i32 > ,
66
+ grid_position : GridPos < u32 > ,
67
67
68
68
has_moved : bool ,
69
69
window_position : PixelPos < f32 > ,
@@ -110,7 +110,7 @@ impl MouseManager {
110
110
& self ,
111
111
window_details : & WindowDrawDetails ,
112
112
editor_state : & EditorState ,
113
- ) -> GridPos < i32 > {
113
+ ) -> GridPos < u32 > {
114
114
let global_bounds = window_details. region ;
115
115
let clamped_position = clamp_position (
116
116
self . window_position ,
@@ -121,6 +121,7 @@ impl MouseManager {
121
121
122
122
( relative_position / * editor_state. grid_scale )
123
123
. floor ( )
124
+ . max ( ( 0.0 , 0.0 ) . into ( ) )
124
125
. cast ( )
125
126
}
126
127
@@ -157,7 +158,7 @@ impl MouseManager {
157
158
send_ui ( SerialCommand :: Drag {
158
159
button : mouse_button_to_button_text ( drag_details. button ) . unwrap ( ) ,
159
160
grid_id : window_details. event_grid_id ( ) ,
160
- position : self . grid_position . try_cast ( ) . unwrap ( ) . to_tuple ( ) ,
161
+ position : self . grid_position . to_tuple ( ) ,
161
162
modifier_string : editor_state
162
163
. keyboard_manager
163
164
. format_modifier_string ( "" , true ) ,
@@ -168,7 +169,7 @@ impl MouseManager {
168
169
button : "move" . into ( ) ,
169
170
action : "" . into ( ) , // this is ignored by nvim
170
171
grid_id : window_details. event_grid_id ( ) ,
171
- position : relative_position. try_cast ( ) . unwrap ( ) . to_tuple ( ) ,
172
+ position : relative_position. to_tuple ( ) ,
172
173
modifier_string : editor_state
173
174
. keyboard_manager
174
175
. format_modifier_string ( "" , true ) ,
@@ -208,7 +209,7 @@ impl MouseManager {
208
209
button : button_text. clone ( ) ,
209
210
action,
210
211
grid_id : details. event_grid_id ( ) ,
211
- position : position. try_cast ( ) . unwrap ( ) . to_tuple ( ) ,
212
+ position : position. to_tuple ( ) ,
212
213
modifier_string : editor_state
213
214
. keyboard_manager
214
215
. format_modifier_string ( "" , true ) ,
@@ -255,7 +256,7 @@ impl MouseManager {
255
256
let scroll_command = SerialCommand :: Scroll {
256
257
direction : input_type. to_string ( ) ,
257
258
grid_id,
258
- position : self . grid_position . try_cast ( ) . unwrap ( ) . to_tuple ( ) ,
259
+ position : self . grid_position . to_tuple ( ) ,
259
260
modifier_string : editor_state
260
261
. keyboard_manager
261
262
. format_modifier_string ( "" , true ) ,
@@ -275,7 +276,7 @@ impl MouseManager {
275
276
let scroll_command = SerialCommand :: Scroll {
276
277
direction : input_type. to_string ( ) ,
277
278
grid_id,
278
- position : self . grid_position . try_cast ( ) . unwrap ( ) . to_tuple ( ) ,
279
+ position : self . grid_position . to_tuple ( ) ,
279
280
modifier_string : editor_state
280
281
. keyboard_manager
281
282
. format_modifier_string ( "" , true ) ,
0 commit comments