diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c index 908675c44..768b787ac 100644 --- a/src/backends/meta-monitor.c +++ b/src/backends/meta-monitor.c @@ -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 diff --git a/src/backends/meta-output.c b/src/backends/meta-output.c index 2e8a787db..761435b59 100644 --- a/src/backends/meta-output.c +++ b/src/backends/meta-output.c @@ -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