From 2eb225236eb72f27beec921e9f37ddf58e874fba Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 3 May 2023 12:36:05 +0200 Subject: util/transform: add wlr_output_transform_coords() We hand-roll this in multiple places. --- util/transform.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util') diff --git a/util/transform.c b/util/transform.c index 4cc725fd..de3f8ef4 100644 --- a/util/transform.c +++ b/util/transform.c @@ -23,3 +23,11 @@ enum wl_output_transform wlr_output_transform_compose( } return flipped | rotated; } + +void wlr_output_transform_coords(enum wl_output_transform tr, int *x, int *y) { + if (tr & WL_OUTPUT_TRANSFORM_90) { + int tmp = *x; + *x = *y; + *y = tmp; + } +} -- cgit v1.2.3