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)
|
||||
{
|
||||
MetaOutput *output = meta_monitor_get_main_output (monitor);
|
||||
MetaMonitorTransform new_transform;
|
||||
MetaMonitorTransform inverted_paniel_orientation_transform;
|
||||
|
||||
new_transform = (transform + META_MONITOR_TRANSFORM_FLIPPED -
|
||||
output->panel_orientation_transform) %
|
||||
META_MONITOR_TRANSFORM_FLIPPED;
|
||||
if (meta_monitor_transform_is_flipped (transform))
|
||||
new_transform += META_MONITOR_TRANSFORM_FLIPPED;
|
||||
|
||||
return new_transform;
|
||||
inverted_paniel_orientation_transform =
|
||||
meta_monitor_transform_invert (output->panel_orientation_transform);
|
||||
return meta_monitor_transform_transform (transform,
|
||||
inverted_paniel_orientation_transform);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -66,14 +66,11 @@ MetaMonitorTransform
|
||||
meta_output_logical_to_crtc_transform (MetaOutput *output,
|
||||
MetaMonitorTransform transform)
|
||||
{
|
||||
MetaMonitorTransform new_transform;
|
||||
MetaMonitorTransform panel_orientation_transform;
|
||||
|
||||
new_transform = (transform + output->panel_orientation_transform) %
|
||||
META_MONITOR_TRANSFORM_FLIPPED;
|
||||
if (meta_monitor_transform_is_flipped (transform))
|
||||
new_transform += META_MONITOR_TRANSFORM_FLIPPED;
|
||||
|
||||
return new_transform;
|
||||
panel_orientation_transform = output->panel_orientation_transform;
|
||||
return meta_monitor_transform_transform (transform,
|
||||
panel_orientation_transform);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user