mirror of https://github.com/GNOME/gimp.git
forgot the initialize pixmap_buf when the brush is not scaled
--Sven
This commit is contained in:
parent
5e0093547e
commit
98d58ec1ef
|
@ -1,3 +1,8 @@
|
||||||
|
Thu Sep 2 22:58:13 MEST 1999 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* 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 <tml@iki.fi>
|
1999-09-02 Tor Lillqvist <tml@iki.fi>
|
||||||
|
|
||||||
* plug-ins/script-fu/interp_sliba.c (lreadstring): Accept what
|
* plug-ins/script-fu/interp_sliba.c (lreadstring): Accept what
|
||||||
|
|
|
@ -887,6 +887,8 @@ display_brush (BrushSelectP bsp,
|
||||||
gint i, j;
|
gint i, j;
|
||||||
|
|
||||||
mask_buf = brush->mask;
|
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)
|
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
|
/* TODO: the scale function should scale the pixmap
|
||||||
and the mask in one run */
|
and the mask in one run */
|
||||||
pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask,
|
pixmap_buf = brush_scale_pixmap (pixmap_buf, mask_buf->width, mask_buf->height);
|
||||||
mask_buf->width, mask_buf->height);
|
|
||||||
}
|
}
|
||||||
scale = TRUE;
|
scale = TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,8 +480,11 @@ gimp_context_preview_draw_brush (GimpContextPreview *gcp)
|
||||||
g_return_if_fail (gcp != NULL && GIMP_IS_BRUSH (gcp->data));
|
g_return_if_fail (gcp != NULL && GIMP_IS_BRUSH (gcp->data));
|
||||||
|
|
||||||
brush = GIMP_BRUSH (gcp->data);
|
brush = GIMP_BRUSH (gcp->data);
|
||||||
brush_width = brush->mask->width;
|
mask_buf = brush->mask;
|
||||||
brush_height = brush->mask->height;
|
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)
|
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_width = (gdouble)brush_width / MAX (ratio_x, ratio_y);
|
||||||
brush_height = (gdouble)brush_height / 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))
|
if (GIMP_IS_BRUSH_PIXMAP (brush))
|
||||||
{
|
{
|
||||||
/* TODO: the scale function should scale the pixmap
|
/* TODO: the scale function should scale the pixmap
|
||||||
and the mask in one run */
|
and the mask in one run */
|
||||||
pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask,
|
pixmap_buf = brush_scale_pixmap (pixmap_buf, brush_width, brush_height);
|
||||||
brush_width, brush_height);
|
|
||||||
}
|
}
|
||||||
scale = TRUE;
|
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_x = (gcp->width - brush_width) >> 1;
|
||||||
offset_y = (gcp->height - brush_height) >> 1;
|
offset_y = (gcp->height - brush_height) >> 1;
|
||||||
|
|
|
@ -887,6 +887,8 @@ display_brush (BrushSelectP bsp,
|
||||||
gint i, j;
|
gint i, j;
|
||||||
|
|
||||||
mask_buf = brush->mask;
|
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)
|
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
|
/* TODO: the scale function should scale the pixmap
|
||||||
and the mask in one run */
|
and the mask in one run */
|
||||||
pixmap_buf = brush_scale_pixmap (GIMP_BRUSH_PIXMAP(brush)->pixmap_mask,
|
pixmap_buf = brush_scale_pixmap (pixmap_buf, mask_buf->width, mask_buf->height);
|
||||||
mask_buf->width, mask_buf->height);
|
|
||||||
}
|
}
|
||||||
scale = TRUE;
|
scale = TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue