From 1901ac2ff3db829f5be9ca4ee7a6d249da6bbe4f Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 30 Aug 2004 15:31:22 +0000 Subject: [PATCH] fixed drawing of brushes that extend beyond the preview. 2004-08-30 Sven Neumann * libgimp/gimpbrushmenu.c (gimp_brush_select_preview_draw): fixed drawing of brushes that extend beyond the preview. --- ChangeLog | 9 +++++++-- libgimp/gimpbrushmenu.c | 23 ++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9db1f29b77..a52d9339c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +2004-08-30 Sven Neumann + + * libgimp/gimpbrushmenu.c (gimp_brush_select_preview_draw): fixed + drawing of brushes that extend beyond the preview. + 2004-08-30 Sven Neumann * app/tools/gimpvectortool.[ch] (gimp_vector_tool_status_set): - avoid extensive use of strdup() and strcmp(). The strings are all + avoid excessive use of strdup() and strcmp(). The strings are all constant anyway. 2004-08-30 Michael Natterer @@ -18,7 +23,7 @@ * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-run.c - * app/plug-in/plug-in.c: switch bach to real refcouting for + * app/plug-in/plug-in.c: switch back to real refcounting for plug_in->progress (reopens bug #150194) and enabled the PDB progress code. diff --git a/libgimp/gimpbrushmenu.c b/libgimp/gimpbrushmenu.c index f76e27740a..0e8c7b1bc8 100644 --- a/libgimp/gimpbrushmenu.c +++ b/libgimp/gimpbrushmenu.c @@ -411,24 +411,27 @@ gimp_brush_select_preview_draw (GimpPreviewArea *area, gint y, gint width, gint height, - const guchar *mask_data) + const guchar *mask_data, + gint rowstride) { const guchar *src; guchar *dest; guchar *buf; - guint pixels = width * height; + gint i, j; - buf = g_new (guchar, pixels); + buf = g_new (guchar, width * height); src = mask_data; dest = buf; - while (pixels--) + for (j = 0; j < height; j++) { - *dest = 255 - *src; + const guchar *s = src; - src++; - dest++; + for (i = 0; i < width; i++, s++, dest++) + *dest = 255 - *s; + + src += rowstride; } gimp_preview_area_draw (area, @@ -463,7 +466,9 @@ gimp_brush_select_preview_update (GtkWidget *preview, preview->allocation.height, 0xFF, 0xFF, 0xFF); - gimp_brush_select_preview_draw (area, x, y, width, height, mask_data); + gimp_brush_select_preview_draw (area, + x, y, width, height, + mask_data, brush_width); } static void @@ -519,7 +524,7 @@ gimp_brush_select_popup_open (BrushSelect *brush_sel, /* Draw the brush */ gimp_brush_select_preview_draw (GIMP_PREVIEW_AREA (preview), 0, 0, brush_sel->width, brush_sel->height, - brush_sel->mask_data); + brush_sel->mask_data, brush_sel->width); } static void