[vte/vte-0-34] drawing: Don't overdraw the cell on bold characters



commit ea6de03f67050d637695dabc70384043d44f823a
Author: Christian Persch <chpe gnome org>
Date:   Sat Aug 25 22:36:32 2012 +0200

    drawing: Don't overdraw the cell on bold characters
    
    This was added in comment dcb7fd974bea5fe49d4f5b0344ebdaffc6d7bae1 and is only
    required when using double-strike pseudo-bolding; so only add the extra pixel when
    doing that. This makes the usual case (i.e. using a real bold font) look nicer.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=682692

 src/vte.c     |    4 ++--
 src/vtedraw.c |    2 +-
 src/vtedraw.h |    1 +
 3 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 6752010..bb8e14c 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -10121,7 +10121,7 @@ vte_terminal_draw_cells(VteTerminal *terminal,
 			_vte_draw_fill_rectangle(terminal->pvt->draw,
 					x + terminal->pvt->inner_border.left,
                                         y + terminal->pvt->inner_border.top,
-					columns * column_width + bold,
+					columns * column_width + (_vte_draw_has_bold(terminal->pvt->draw) ? 0 : bold),
 					row_height,
 					bg, VTE_DRAW_OPAQUE);
 		}
@@ -10524,7 +10524,7 @@ vte_terminal_draw_rows(VteTerminal *terminal,
 							terminal->pvt->draw,
 							x + i * column_width,
 							y,
-							(j - i) * column_width + bold,
+							(j - i) * column_width + (_vte_draw_has_bold(terminal->pvt->draw) ? 0 : bold),
 							row_height,
 							&terminal->pvt->palette[back], VTE_DRAW_OPAQUE);
 				}
diff --git a/src/vtedraw.c b/src/vtedraw.c
index 051895a..a0f6a0b 100644
--- a/src/vtedraw.c
+++ b/src/vtedraw.c
@@ -974,7 +974,7 @@ _vte_draw_get_char_width (struct _vte_draw *draw, vteunistr c, int columns,
 	return uinfo->width;
 }
 
-static gboolean
+gboolean
 _vte_draw_has_bold (struct _vte_draw *draw)
 {
 	return (draw->font != draw->font_bold);
diff --git a/src/vtedraw.h b/src/vtedraw.h
index fb08b52..f199b40 100644
--- a/src/vtedraw.h
+++ b/src/vtedraw.h
@@ -97,6 +97,7 @@ void _vte_draw_get_text_metrics(struct _vte_draw *draw,
 				gint *width, gint *height, gint *ascent);
 int _vte_draw_get_char_width(struct _vte_draw *draw, vteunistr c, int columns,
 			     gboolean bold);
+gboolean _vte_draw_has_bold (struct _vte_draw *draw);
 
 void _vte_draw_text(struct _vte_draw *draw,
 		    struct _vte_draw_text_request *requests, gsize n_requests,



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