[gimp] app: GimpRuler: clip position marker drawing to the ruler's allocation



commit 59ea89234ff3f03038793601672ac416cf6f7f7f
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 20 00:31:59 2011 +0200

    app: GimpRuler: clip position marker drawing to the ruler's allocation
    
    so we don't overdraw when drawing out of expose.

 libgimpwidgets/gimpruler.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index 91c4ef4..7034fa6 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -1192,6 +1192,11 @@ gimp_ruler_draw_pos (GimpRuler *ruler)
       gdouble  position;
       gdouble  increment;
 
+      cairo_rectangle (cr,
+                       allocation.x, allocation.y,
+                       allocation.width, allocation.height);
+      cairo_clip (cr);
+
       cairo_translate (cr, allocation.x, allocation.y);
 
       /*  If a backing store exists, restore the ruler  */
@@ -1202,7 +1207,6 @@ gimp_ruler_draw_pos (GimpRuler *ruler)
           cairo_fill (cr);
         }
 
-
       position = gimp_ruler_get_position (ruler);
 
       gimp_ruler_get_range (ruler, &lower, &upper, NULL);



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