From dbce9d49d90587f2922ebb18541362f5ac5ba9f0 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 3 Oct 2010 00:52:46 +0200 Subject: [PATCH] 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 deletion(-) diff --git a/app/display/gimpcanvasgrid.c b/app/display/gimpcanvasgrid.c index 52248860d9..660d2806e0 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 2102e64eb3..92685b70fa 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 931dbe2630..277640803d 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); }