[gtkhtml] Fix text focus rectangle.



commit 18c3483e27907a9c5e93471b0233e8fa0f3cd5a5
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Oct 29 15:44:55 2010 -0400

    Fix text focus rectangle.

 gtkhtml/htmltextslave.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtkhtml/htmltextslave.c b/gtkhtml/htmltextslave.c
index 15837d0..07b8a92 100644
--- a/gtkhtml/htmltextslave.c
+++ b/gtkhtml/htmltextslave.c
@@ -854,7 +854,7 @@ static void
 draw_focus_rectangle  (HTMLTextSlave *slave, HTMLPainter *painter, GdkRectangle *box)
 {
 	HTMLGdkPainter *p;
-	const double dashes[] = { 1, 1 };
+	const double dashes[] = { 1, 2 };
 	int ndash = G_N_ELEMENTS (dashes);
 	HTMLEngine *e;
 
@@ -874,8 +874,13 @@ draw_focus_rectangle  (HTMLTextSlave *slave, HTMLPainter *painter, GdkRectangle
 				    &html_colorset_get_color_allocated (e->settings->color_set,
 									painter, HTMLTextColor)->color);
 	cairo_set_line_cap (p->cr, CAIRO_LINE_CAP_ROUND);
+	cairo_set_line_width (p->cr, 1);
 	cairo_set_dash (p->cr, dashes, ndash, 2);
-	cairo_rectangle (p->cr, box->x - p->x1, box->y - p->y1, box->width - 1, box->height - 1);
+	cairo_rectangle (
+		p->cr,
+		box->x - p->x1 - 0.5,
+		box->y - p->y1 + 0.5,
+		box->width + 1, box->height);
 	cairo_stroke (p->cr);
 	cairo_restore (p->cr);
 }



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