mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
pointer-constraints/native: Remove old clutter float math work around
There were some coordinate nudging to avoid running into Clutter floating point math issues related to coordinate transformations. Over the years these things have improved, especially with the move to graphene, so remove the old work around. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2460>
This commit is contained in:
parent
71ea01f54c
commit
94aaa65bd2
@ -409,23 +409,13 @@ clamp_to_border (MetaBorder *border,
|
||||
* clamped so that the destination coordinate does not end up on the border
|
||||
* (see weston_pointer_clamp_event_to_region). Do this by clamping such
|
||||
* motions to the border minus the smallest possible wl_fixed_t value.
|
||||
*
|
||||
* When clamping in either leftward or upward motion, the resulting coordinate
|
||||
* needs to be clamped so that it is enough on the inside to avoid the
|
||||
* inaccuracies of clutter's stage to actor transformation algorithm (the one
|
||||
* used in clutter_actor_transform_stage_point) to make it end up outside the
|
||||
* next motion. It also needs to be clamped so that to the wl_fixed_t
|
||||
* coordinate may still be right on the border (i.e. at .0). Testing shows
|
||||
* that the smallest wl_fixed_t value divided by 10 is small enough to make
|
||||
* the wl_fixed_t coordinate .0 and large enough to avoid the inaccuracies of
|
||||
* clutters transform algorithm.
|
||||
*/
|
||||
if (meta_border_is_horizontal (border))
|
||||
{
|
||||
if (*motion_dir & META_BORDER_MOTION_DIRECTION_POSITIVE_Y)
|
||||
motion->b.y = border->line.a.y - wl_fixed_to_double (1);
|
||||
else
|
||||
motion->b.y = border->line.a.y + wl_fixed_to_double (1) / 10;
|
||||
motion->b.y = border->line.a.y;
|
||||
*motion_dir &= ~(META_BORDER_MOTION_DIRECTION_POSITIVE_Y |
|
||||
META_BORDER_MOTION_DIRECTION_NEGATIVE_Y);
|
||||
}
|
||||
@ -434,7 +424,7 @@ clamp_to_border (MetaBorder *border,
|
||||
if (*motion_dir & META_BORDER_MOTION_DIRECTION_POSITIVE_X)
|
||||
motion->b.x = border->line.a.x - wl_fixed_to_double (1);
|
||||
else
|
||||
motion->b.x = border->line.a.x + wl_fixed_to_double (1) / 10;
|
||||
motion->b.x = border->line.a.x;
|
||||
*motion_dir &= ~(META_BORDER_MOTION_DIRECTION_POSITIVE_X |
|
||||
META_BORDER_MOTION_DIRECTION_NEGATIVE_X);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user