summaryrefslogtreecommitdiff
path: root/utils/viewer-pangocairo.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-29 16:21:44 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-29 16:27:19 -0400
commit79070d5eb96d89cf05d31d61a31a3b2c893f54f3 (patch)
treec2b932969c9d31c79145300d8a2842c548a44413 /utils/viewer-pangocairo.c
parent69c25b9cb70c73c0ec215170009185bfea60165d (diff)
downloadpango-79070d5eb96d89cf05d31d61a31a3b2c893f54f3.tar.gz
pango-view: Fix slope of carets
We want vertical carets to be really vertical.
Diffstat (limited to 'utils/viewer-pangocairo.c')
-rw-r--r--utils/viewer-pangocairo.c6
1 files 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);
}