diff --git a/ChangeLog b/ChangeLog index a13c1bff4e..38ff7240e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 2 22:58:13 MEST 1999 Sven Neumann + + * app/brush_select.c: fixed a stupid bug I introduced today. + * app/gimpcontextpreview.c: for consistency, do it the same way here. + 1999-09-02 Tor Lillqvist * plug-ins/script-fu/interp_sliba.c (lreadstring): Accept what diff --git a/app/brush_select.c b/app/brush_select.c index f2adb7b4c7..14b7081b25 100644 --- a/app/brush_select.c +++ b/app/brush_select.c @@ -887,6 +887,8 @@ display_brush (BrushSelectP bsp, gint i, j; mask_buf = brush->mask; + if (GIMP_IS_BRUSH_PIXMAP (brush)) + pixmap_buf = GIMP_BRUSH_PIXMAP(brush)->pixmap_mask; if (mask_buf->width > bsp->cell_width || mask_buf->height > bsp->cell_height) { @@ -900,8 +902,7 @@ display_brush (BrushSelectP bsp, { /* TODO: the scale function should scale the pixmap and the mask in one run */ - pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask, - mask_buf->width, mask_buf->height); + pixmap_buf = brush_scale_pixmap (pixmap_buf, mask_buf->width, mask_buf->height); } scale = TRUE; } diff --git a/app/gimpcontextpreview.c b/app/gimpcontextpreview.c index b67099555b..4b3437f663 100644 --- a/app/gimpcontextpreview.c +++ b/app/gimpcontextpreview.c @@ -480,8 +480,11 @@ gimp_context_preview_draw_brush (GimpContextPreview *gcp) g_return_if_fail (gcp != NULL && GIMP_IS_BRUSH (gcp->data)); brush = GIMP_BRUSH (gcp->data); - brush_width = brush->mask->width; - brush_height = brush->mask->height; + mask_buf = brush->mask; + if (GIMP_IS_BRUSH_PIXMAP (brush)) + pixmap_buf = GIMP_BRUSH_PIXMAP(brush)->pixmap_mask; + brush_width = mask_buf->width; + brush_height = mask_buf->height; if (brush_width > gcp->width || brush_height > gcp->height) { @@ -491,22 +494,15 @@ gimp_context_preview_draw_brush (GimpContextPreview *gcp) brush_width = (gdouble)brush_width / MAX (ratio_x, ratio_y); brush_height = (gdouble)brush_height / MAX (ratio_x, ratio_y); - mask_buf = brush_scale_mask (brush->mask, brush_width, brush_height); + mask_buf = brush_scale_mask (mask_buf, brush_width, brush_height); if (GIMP_IS_BRUSH_PIXMAP (brush)) { /* TODO: the scale function should scale the pixmap and the mask in one run */ - pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask, - brush_width, brush_height); + pixmap_buf = brush_scale_pixmap (pixmap_buf, brush_width, brush_height); } scale = TRUE; } - else - { - mask_buf = brush->mask; - if (GIMP_IS_BRUSH_PIXMAP (brush)) - pixmap_buf = GIMP_BRUSH_PIXMAP(brush)->pixmap_mask; - } offset_x = (gcp->width - brush_width) >> 1; offset_y = (gcp->height - brush_height) >> 1; diff --git a/app/gui/brush-select.c b/app/gui/brush-select.c index f2adb7b4c7..14b7081b25 100644 --- a/app/gui/brush-select.c +++ b/app/gui/brush-select.c @@ -887,6 +887,8 @@ display_brush (BrushSelectP bsp, gint i, j; mask_buf = brush->mask; + if (GIMP_IS_BRUSH_PIXMAP (brush)) + pixmap_buf = GIMP_BRUSH_PIXMAP(brush)->pixmap_mask; if (mask_buf->width > bsp->cell_width || mask_buf->height > bsp->cell_height) { @@ -900,8 +902,7 @@ display_brush (BrushSelectP bsp, { /* TODO: the scale function should scale the pixmap and the mask in one run */ - pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask, - mask_buf->width, mask_buf->height); + pixmap_buf = brush_scale_pixmap (pixmap_buf, mask_buf->width, mask_buf->height); } scale = TRUE; }