[gtksourceview: 1/2] SpaceDrawer: Draw tabs so that their endpoints align
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview: 1/2] SpaceDrawer: Draw tabs so that their endpoints align
- Date: Mon, 11 May 2020 17:07:44 +0000 (UTC)
commit 64a313c828b359ec2767f73e7e1baca730cb7b6d
Author: Rewi Haar <rewi-github whanau org>
Date: Mon May 11 01:44:41 2020 +1200
SpaceDrawer: Draw tabs so that their endpoints align
Previously, tabs were drawn with padding of 1/8 of the width of the
actual tab character. However, because tabs aren't always the same
width (even in the same document), this could cause their endpoints to
not line up. This resolves this issue by making the padding on either
side of the symbol instead proportional to the height of the tab, which
is fixed for a given font size.
gtksourceview/gtksourcespacedrawer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/gtksourcespacedrawer.c b/gtksourceview/gtksourcespacedrawer.c
index f6b1cf7d..40754f43 100644
--- a/gtksourceview/gtksourcespacedrawer.c
+++ b/gtksourceview/gtksourcespacedrawer.c
@@ -841,8 +841,8 @@ draw_tab_at_pos (cairo_t *cr,
h = rect.height;
cairo_save (cr);
- cairo_move_to (cr, x + w * 1 / 8, y);
- cairo_rel_line_to (cr, w * 6 / 8, 0);
+ cairo_move_to (cr, x + h * 1 / 6, y);
+ cairo_rel_line_to (cr, w - h * 2 / 6, 0);
cairo_rel_line_to (cr, -h * 1 / 4, -h * 1 / 4);
cairo_rel_move_to (cr, +h * 1 / 4, +h * 1 / 4);
cairo_rel_line_to (cr, -h * 1 / 4, +h * 1 / 4);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]