mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 08:30:42 -05:00
backends/native: Minor refactor
Refactor code so that variables don't depend the on motion line content, but the other way around. This makes it clearer what each vector means. This has no functional changes. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2803>
This commit is contained in:
parent
5235f2b4ac
commit
34a9141a6c
@ -1169,9 +1169,12 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
|
|||||||
|
|
||||||
meta_viewport_info_get_view_info (viewports, cur_view, &rect, &scale);
|
meta_viewport_info_get_view_info (viewports, cur_view, &rect, &scale);
|
||||||
|
|
||||||
|
target_x = x + (dx * scale);
|
||||||
|
target_y = y + (dy * scale);
|
||||||
|
|
||||||
motion = (MetaLine2) {
|
motion = (MetaLine2) {
|
||||||
.a = { x, y },
|
.a = { x, y },
|
||||||
.b = { x + (dx * scale), y + (dy * scale) }
|
.b = { target_x, target_y }
|
||||||
};
|
};
|
||||||
left = (MetaLine2) {
|
left = (MetaLine2) {
|
||||||
{ rect.x, rect.y },
|
{ rect.x, rect.y },
|
||||||
@ -1190,9 +1193,6 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
|
|||||||
{ rect.x + rect.width, rect.y + rect.height }
|
{ rect.x + rect.width, rect.y + rect.height }
|
||||||
};
|
};
|
||||||
|
|
||||||
target_x = motion.b.x;
|
|
||||||
target_y = motion.b.y;
|
|
||||||
|
|
||||||
if (direction != META_DISPLAY_RIGHT &&
|
if (direction != META_DISPLAY_RIGHT &&
|
||||||
meta_line2_intersects_with (&motion, &left, &intersection))
|
meta_line2_intersects_with (&motion, &left, &intersection))
|
||||||
direction = META_DISPLAY_LEFT;
|
direction = META_DISPLAY_LEFT;
|
||||||
@ -1209,10 +1209,10 @@ relative_motion_across_outputs (MetaViewportInfo *viewports,
|
|||||||
/* We reached the dest logical monitor */
|
/* We reached the dest logical monitor */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
dx -= intersection.x - x;
|
||||||
|
dy -= intersection.y - y;
|
||||||
x = intersection.x;
|
x = intersection.x;
|
||||||
y = intersection.y;
|
y = intersection.y;
|
||||||
dx -= intersection.x - motion.a.x;
|
|
||||||
dy -= intersection.y - motion.a.y;
|
|
||||||
|
|
||||||
cur_view = meta_viewport_info_get_neighbor (viewports, cur_view,
|
cur_view = meta_viewport_info_get_neighbor (viewports, cur_view,
|
||||||
direction);
|
direction);
|
||||||
|
Loading…
Reference in New Issue
Block a user