[gimp] app: fix scrolling in of dashed lines



commit dbce9d49d90587f2922ebb18541362f5ac5ba9f0
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 3 00:52:46 2010 +0200

    app: fix scrolling in of dashed lines
    
    Before, the pattern offset was always relative to the widget, which
    completely destroyed the stipples when the got scrolled in. Now we
    simply set the shell's scroll offsets as cairo translation and
    everything looks perfect.

 app/display/gimpcanvasgrid.c          |    1 +
 app/display/gimpcanvasguide.c         |    1 +
 app/display/gimpcanvaslayerboundary.c |    2 +-
 3 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/app/display/gimpcanvasgrid.c b/app/display/gimpcanvasgrid.c
index 5224886..660d280 100644
--- a/app/display/gimpcanvasgrid.c
+++ b/app/display/gimpcanvasgrid.c
@@ -376,6 +376,7 @@ gimp_canvas_grid_stroke (GimpCanvasItem   *item,
 
   if (private->grid_style)
     {
+      cairo_translate (cr, -shell->offset_x, -shell->offset_y);
       gimp_display_shell_set_grid_style (shell, cr, private->grid);
       cairo_stroke (cr);
     }
diff --git a/app/display/gimpcanvasguide.c b/app/display/gimpcanvasguide.c
index 2102e64..92685b7 100644
--- a/app/display/gimpcanvasguide.c
+++ b/app/display/gimpcanvasguide.c
@@ -253,6 +253,7 @@ gimp_canvas_guide_stroke (GimpCanvasItem   *item,
 
   if (private->guide_style)
     {
+      cairo_translate (cr, -shell->offset_x, -shell->offset_y);
       gimp_display_shell_set_guide_style (shell, cr,
                                           gimp_canvas_item_get_highlight (item));
       cairo_stroke (cr);
diff --git a/app/display/gimpcanvaslayerboundary.c b/app/display/gimpcanvaslayerboundary.c
index 931dbe2..2776408 100644
--- a/app/display/gimpcanvaslayerboundary.c
+++ b/app/display/gimpcanvaslayerboundary.c
@@ -183,8 +183,8 @@ gimp_canvas_layer_boundary_stroke (GimpCanvasItem   *item,
 {
   GimpCanvasLayerBoundaryPrivate *private = GET_PRIVATE (item);
 
+  cairo_translate (cr, -shell->offset_x, -shell->offset_y);
   gimp_display_shell_set_layer_style (shell, cr, private->layer);
-
   cairo_stroke (cr);
 }
 



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