@@ -1416,10 +1416,10 @@ void WaylandThread::_wl_pointer_on_motion(void *data, struct wl_pointer *wl_poin
1416
1416
PointerData &pd = ss->pointer_data_buffer ;
1417
1417
1418
1418
// TODO: Scale only when sending the Wayland message.
1419
- pd.position .x = wl_fixed_to_int (surface_x);
1420
- pd.position .y = wl_fixed_to_int (surface_y);
1419
+ pd.position .x = wl_fixed_to_double (surface_x);
1420
+ pd.position .y = wl_fixed_to_double (surface_y);
1421
1421
1422
- pd.position = scale_vector2i (pd. position , window_state_get_scale_factor (ws) );
1422
+ pd.position *= window_state_get_scale_factor (ws);
1423
1423
1424
1424
pd.motion_time = time ;
1425
1425
}
@@ -1532,7 +1532,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
1532
1532
mm->set_position (pd.position );
1533
1533
mm->set_global_position (pd.position );
1534
1534
1535
- Vector2i pos_delta = pd.position - old_pd.position ;
1535
+ Vector2 pos_delta = pd.position - old_pd.position ;
1536
1536
1537
1537
if (old_pd.relative_motion_time != pd.relative_motion_time ) {
1538
1538
uint32_t time_delta = pd.relative_motion_time - old_pd.relative_motion_time ;
@@ -1649,7 +1649,7 @@ void WaylandThread::_wl_pointer_on_frame(void *data, struct wl_pointer *wl_point
1649
1649
1650
1650
// We have to set the last position pressed here as we can't take for
1651
1651
// granted what the individual events might have seen due to them not having
1652
- // a garaunteed order.
1652
+ // a guaranteed order.
1653
1653
if (mb->is_pressed ()) {
1654
1654
pd.last_pressed_position = pd.position ;
1655
1655
}
@@ -2388,9 +2388,9 @@ void WaylandThread::_wp_tablet_tool_on_motion(void *data, struct zwp_tablet_tool
2388
2388
2389
2389
double scale_factor = window_state_get_scale_factor (ws);
2390
2390
2391
- td.position .x = wl_fixed_to_int (x);
2392
- td.position .y = wl_fixed_to_int (y);
2393
- td.position = scale_vector2i (td. position , scale_factor) ;
2391
+ td.position .x = wl_fixed_to_double (x);
2392
+ td.position .y = wl_fixed_to_double (y);
2393
+ td.position *= scale_factor;
2394
2394
2395
2395
td.motion_time = OS::get_singleton ()->get_ticks_msec ();
2396
2396
}
@@ -2520,7 +2520,7 @@ void WaylandThread::_wp_tablet_tool_on_frame(void *data, struct zwp_tablet_tool_
2520
2520
mm->set_relative (td.position - old_td.position );
2521
2521
mm->set_relative_screen_position (mm->get_relative ());
2522
2522
2523
- Vector2i pos_delta = td.position - old_td.position ;
2523
+ Vector2 pos_delta = td.position - old_td.position ;
2524
2524
uint32_t time_delta = td.motion_time - old_td.motion_time ;
2525
2525
mm->set_velocity ((Vector2)pos_delta / time_delta);
2526
2526
0 commit comments