mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
monitor: Use transform helper when dealing with panel orientation
Replace the open coded monitor transform math with the new helper. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1064
This commit is contained in:
parent
e6913d1471
commit
92f0eb9d14
@ -467,15 +467,12 @@ meta_monitor_crtc_to_logical_transform (MetaMonitor *monitor,
|
|||||||
MetaMonitorTransform transform)
|
MetaMonitorTransform transform)
|
||||||
{
|
{
|
||||||
MetaOutput *output = meta_monitor_get_main_output (monitor);
|
MetaOutput *output = meta_monitor_get_main_output (monitor);
|
||||||
MetaMonitorTransform new_transform;
|
MetaMonitorTransform inverted_paniel_orientation_transform;
|
||||||
|
|
||||||
new_transform = (transform + META_MONITOR_TRANSFORM_FLIPPED -
|
inverted_paniel_orientation_transform =
|
||||||
output->panel_orientation_transform) %
|
meta_monitor_transform_invert (output->panel_orientation_transform);
|
||||||
META_MONITOR_TRANSFORM_FLIPPED;
|
return meta_monitor_transform_transform (transform,
|
||||||
if (meta_monitor_transform_is_flipped (transform))
|
inverted_paniel_orientation_transform);
|
||||||
new_transform += META_MONITOR_TRANSFORM_FLIPPED;
|
|
||||||
|
|
||||||
return new_transform;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -66,14 +66,11 @@ MetaMonitorTransform
|
|||||||
meta_output_logical_to_crtc_transform (MetaOutput *output,
|
meta_output_logical_to_crtc_transform (MetaOutput *output,
|
||||||
MetaMonitorTransform transform)
|
MetaMonitorTransform transform)
|
||||||
{
|
{
|
||||||
MetaMonitorTransform new_transform;
|
MetaMonitorTransform panel_orientation_transform;
|
||||||
|
|
||||||
new_transform = (transform + output->panel_orientation_transform) %
|
panel_orientation_transform = output->panel_orientation_transform;
|
||||||
META_MONITOR_TRANSFORM_FLIPPED;
|
return meta_monitor_transform_transform (transform,
|
||||||
if (meta_monitor_transform_is_flipped (transform))
|
panel_orientation_transform);
|
||||||
new_transform += META_MONITOR_TRANSFORM_FLIPPED;
|
|
||||||
|
|
||||||
return new_transform;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user