diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index bbfb17b9d5..952731d6c4 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -129,33 +129,6 @@ gimp_display_shell_draw_get_scaled_image_size_for_scale (GimpDisplayShell *shell if (h) *h = PROJ_ROUND (level_height * (scale_y * (1 << level))); } -void -gimp_display_shell_draw_guide (GimpDisplayShell *shell, - cairo_t *cr, - GimpGuide *guide, - gboolean active) -{ - GimpCanvasItem *item; - gint position; - - g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - g_return_if_fail (cr != NULL); - g_return_if_fail (GIMP_IS_GUIDE (guide)); - - position = gimp_guide_get_position (guide); - if (position < 0) - return; - - item = gimp_canvas_guide_new (gimp_guide_get_orientation (guide), position); - - g_object_set (item, "guide-style", TRUE, NULL); - gimp_canvas_item_set_highlight (item, active); - - gimp_canvas_item_draw (item, shell, cr); - - g_object_unref (item); -} - void gimp_display_shell_draw_guides (GimpDisplayShell *shell, cairo_t *cr) @@ -169,14 +142,32 @@ gimp_display_shell_draw_guides (GimpDisplayShell *shell, if (image && gimp_display_shell_get_show_guides (shell)) { - GList *list; + GimpCanvasItem *item; + GList *list; + + item = gimp_canvas_guide_new (GIMP_ORIENTATION_HORIZONTAL, 0); + g_object_set (item, "guide-style", TRUE, NULL); for (list = gimp_image_get_guides (image); list; list = g_list_next (list)) { - gimp_display_shell_draw_guide (shell, cr, list->data, FALSE); + GimpGuide *guide = list->data; + gint position; + + position = gimp_guide_get_position (guide); + + if (position >= 0) + { + g_object_set (item, + "orientation", gimp_guide_get_orientation (guide), + "position", position, + NULL); + gimp_canvas_item_draw (item, shell, cr); + } } + + g_object_unref (item); } } diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h index 73e71bbf8c..5b5bb9dfb9 100644 --- a/app/display/gimpdisplayshell-draw.h +++ b/app/display/gimpdisplayshell-draw.h @@ -27,10 +27,6 @@ void gimp_display_shell_draw_get_scaled_image_size_for_scale gdouble scale, gint *w, gint *h); -void gimp_display_shell_draw_guide (GimpDisplayShell *shell, - cairo_t *cr, - GimpGuide *guide, - gboolean active); void gimp_display_shell_draw_guides (GimpDisplayShell *shell, cairo_t *cr); void gimp_display_shell_draw_grid (GimpDisplayShell *shell,