From 769acb57b16f99b453cba5ec3441e87a5b3cd277 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Sat, 6 Aug 2005 11:23:58 +0000 Subject: [PATCH] fixed handling of line width --- app/display/gimpdisplayshell-draw.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 11cf66fb0f..5529ffbbc2 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -51,8 +51,7 @@ static GdkGC * gimp_display_shell_get_grid_gc (GimpDisplayShell *shell, GimpGrid *grid); static GdkGC * gimp_display_shell_get_pen_gc (GimpDisplayShell *shell, GimpContext *context, - GimpActiveColor active, - gint width); + GimpActiveColor active); /* public functions */ @@ -306,10 +305,11 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell, GimpActiveColor color, gint width) { - GimpCanvas *canvas; - GdkGC *gc; - GdkPoint *coords; - gint i; + GimpCanvas *canvas; + GdkGC *gc; + GdkGCValues values; + GdkPoint *coords; + gint i; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_CONTEXT (context)); @@ -325,7 +325,10 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell, &coords[i].x, &coords[i].y, FALSE); - gc = gimp_display_shell_get_pen_gc (shell, context, color, width); + gc = gimp_display_shell_get_pen_gc (shell, context, color); + + values.line_width = MAX (1, width); + gdk_gc_set_values (gc, &values, GDK_GC_LINE_WIDTH); gimp_canvas_set_custom_gc (canvas, gc); gimp_canvas_draw_lines (canvas, GIMP_CANVAS_STYLE_CUSTOM, coords, num_points); @@ -620,8 +623,7 @@ gimp_display_shell_get_grid_gc (GimpDisplayShell *shell, static GdkGC * gimp_display_shell_get_pen_gc (GimpDisplayShell *shell, GimpContext *context, - GimpActiveColor active, - gint width) + GimpActiveColor active) { GdkGCValues values; GimpRGB rgb; @@ -630,14 +632,12 @@ gimp_display_shell_get_pen_gc (GimpDisplayShell *shell, if (shell->pen_gc) return shell->pen_gc; - values.line_width = MAX (1, width); values.line_style = GDK_LINE_SOLID; values.cap_style = GDK_CAP_ROUND; values.join_style = GDK_JOIN_MITER; shell->pen_gc = gdk_gc_new_with_values (shell->canvas->window, - &values, (GDK_GC_LINE_WIDTH | - GDK_GC_LINE_STYLE | + &values, (GDK_GC_LINE_STYLE | GDK_GC_CAP_STYLE | GDK_GC_JOIN_STYLE));