From c2bb4548c4864ecbf62daca65b2e833615bc1579 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 27 Aug 2021 17:08:30 -0400 Subject: carets: Fix rect for negative slopes The intention was to flip the rectangle horizontally. We do return a negative width, but we forgot to flip the origin. --- pango/pango-layout.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pango') diff --git a/pango/pango-layout.c b/pango/pango-layout.c index f88581f1..ac396ba0 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2718,12 +2718,16 @@ pango_layout_get_caret_pos (PangoLayout *layout, { strong_pos->x += descender * slope_inv; strong_pos->width = strong_pos->height * slope_inv; + if (slope_inv < 0) + strong_pos->x -= strong_pos->width; } if (weak_pos) { weak_pos->x += descender * slope_inv; weak_pos->width = weak_pos->height * slope_inv; + if (slope_inv < 0) + weak_pos->x -= weak_pos->width; } } } -- cgit v1.2.1