[pango/matthiasc/for-main: 4/4] pango-view: Fix slope of carets




commit 79070d5eb96d89cf05d31d61a31a3b2c893f54f3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 29 16:21:44 2021 -0400

    pango-view: Fix slope of carets
    
    We want vertical carets to be really vertical.

 utils/viewer-pangocairo.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/utils/viewer-pangocairo.c b/utils/viewer-pangocairo.c
index f1d6bcae..a6a416ee 100644
--- a/utils/viewer-pangocairo.c
+++ b/utils/viewer-pangocairo.c
@@ -562,13 +562,11 @@ render_callback (PangoLayout *layout,
               pango_layout_get_caret_pos (layout, p - text, &rect, NULL);
 
               cairo_move_to (cr,
-                             (double)rect.x / PANGO_SCALE - lw / 2
-                              + (double)rect.width / PANGO_SCALE + lw,
+                             (double)rect.x / PANGO_SCALE + (double)rect.width / PANGO_SCALE - lw / 2,
                              (double)rect.y / PANGO_SCALE - lw / 2);
               cairo_line_to (cr,
                              (double)rect.x / PANGO_SCALE - lw / 2,
-                             (double)rect.y / PANGO_SCALE - lw / 2
-                              + (double)rect.height / PANGO_SCALE + lw);
+                             (double)rect.y / PANGO_SCALE + (double)rect.height / PANGO_SCALE - lw / 2);
               cairo_stroke (cr);
             }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]