[vte] Bug 603713 - ibeam/underline cursor broken with large inner-border



commit 47406a81f737f6f01fd148ab004de4eac641d571
Author: Behdad Esfahbod <behdad behdad org>
Date:   Thu Dec 3 13:26:25 2009 -0500

    Bug 603713 - ibeam/underline cursor broken with large inner-border

 src/vte.c |   46 +++++++++++++++++-----------------------------
 1 files changed, 17 insertions(+), 29 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index d8a53e4..2824554 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -8716,12 +8716,12 @@ vte_terminal_unichar_is_local_graphic(VteTerminal *terminal, vteunistr c, gboole
 }
 
 static void
-vte_terminal_fill_rectangle_int(VteTerminal *terminal,
-				struct vte_palette_entry *entry,
-				gint x,
-				gint y,
-				gint width,
-				gint height)
+vte_terminal_fill_rectangle(VteTerminal *terminal,
+			    struct vte_palette_entry *entry,
+			    gint x,
+			    gint y,
+			    gint width,
+			    gint height)
 {
 	GdkColor color;
 	gboolean wasdrawing;
@@ -8744,17 +8744,6 @@ vte_terminal_fill_rectangle_int(VteTerminal *terminal,
 }
 
 static void
-vte_terminal_fill_rectangle(VteTerminal *terminal,
-			    struct vte_palette_entry *entry,
-			    gint x,
-			    gint y,
-			    gint width,
-			    gint height)
-{
-	vte_terminal_fill_rectangle_int(terminal, entry, x, y, width, height);
-}
-
-static void
 vte_terminal_draw_line(VteTerminal *terminal,
 		       struct vte_palette_entry *entry,
 		       gint x,
@@ -10494,31 +10483,30 @@ vte_terminal_paint_cursor(VteTerminal *terminal)
 			TRUE^(reverse|selected), selected, TRUE,
 			&fore, &back);
 
-	x = item.x + terminal->pvt->inner_border.left;
-	y = item.y + terminal->pvt->inner_border.top;
+	x = item.x;
+	y = item.y;
 
 	switch (terminal->pvt->cursor_shape) {
 
 		case VTE_CURSOR_SHAPE_IBEAM:
 		 	
-			vte_terminal_draw_line(terminal, &terminal->pvt->palette[back],
-					       x - 2*VTE_LINE_WIDTH,
-					       y,
-					       x - 2*VTE_LINE_WIDTH,
-					       y + height - 1);
+			vte_terminal_fill_rectangle(terminal, &terminal->pvt->palette[back],
+						     x, y,
+						     VTE_LINE_WIDTH, height);
 			break;
 
 		case VTE_CURSOR_SHAPE_UNDERLINE:
 
-			vte_terminal_draw_line(terminal, &terminal->pvt->palette[back],
-					       x,
-					       y + height - VTE_LINE_WIDTH,
-					       x + cursor_width - 1,
-					       y + height - VTE_LINE_WIDTH);
+			vte_terminal_fill_rectangle(terminal, &terminal->pvt->palette[back],
+						     x, y + height - VTE_LINE_WIDTH,
+						     cursor_width, VTE_LINE_WIDTH);
 			break;
 
 		case VTE_CURSOR_SHAPE_BLOCK:
 
+			x += terminal->pvt->inner_border.left;
+			y += terminal->pvt->inner_border.top;
+
 			color.red = terminal->pvt->palette[back].red;
 			color.green = terminal->pvt->palette[back].green;
 			color.blue = terminal->pvt->palette[back].blue;



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