[hitori] Bug 652684 — Display glitch when marking hints



commit ce0a0a25d77c7fa0d5f0a8fed87036dada128f89
Author: Peter De Wachter <pdewacht gmail com>
Date:   Sat Jun 18 19:22:47 2011 +0100

    Bug 652684 â Display glitch when marking hints
    
    Fix the drawing of hints to not rely on the clipping area for redrawing a
    particular cell, as the clipping area may be bigger than we expect if, for
    example, the hint is drawn just after the play area is resized.
    
    Closes: bgo#652684

 src/interface.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/interface.c b/src/interface.c
index 3afff96..d9488fd 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -232,9 +232,14 @@ hitori_draw_cb (GtkWidget *drawing_area, cairo_t *cr, Hitori *hitori)
 
 	/* Draw a hint if applicable */
 	if (hitori->hint_status % 2 == 1) {
+		gfloat line_width = border.left * 2.5;
 		cairo_set_source_rgb (cr, 1, 0, 0); /* red */
-		cairo_set_line_width (cr, border.left * 5.0);
-		cairo_rectangle (cr, hitori->hint_position.x * cell_size, hitori->hint_position.y * cell_size, cell_size, cell_size);
+		cairo_set_line_width (cr, line_width);
+		cairo_rectangle (cr,
+				 hitori->hint_position.x * cell_size + line_width / 2,
+				 hitori->hint_position.y * cell_size + line_width / 2,
+				 cell_size - line_width,
+				 cell_size - line_width);
 		cairo_stroke (cr);
 	}
 



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