Correctly initialize the max arrays in thin_region. Fixes bug #8351 return

* app/paint_funcs.c: Correctly initialize the max arrays in
        thin_region. Fixes bug #8351
        * app/scale.c: return from the channel_scale function if we
        tried to zoom in/out too far.  This prevents some
        unnecessary display redraws.
This commit is contained in:
jaycox 2000-04-28 23:59:40 +00:00
parent b6b59debdd
commit ce4234b2a6
6 changed files with 30 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2000-04-28 Jay Cox <jaycox@earthlink.net>
* app/paint_funcs.c: Correctly initialize the max arrays in
thin_region. Fixes bug #8351
* app/scale.c: return from the channel_scale function if we
tried to zoom in/out too far. This prevents some
unnecessary display redraws.
2000-04-28 Sven Neumann <sven@gimp.org>
* plug-ins/print/print-util.c: do not use error_t, some systems

View file

@ -113,6 +113,8 @@ change_scale (GDisplay *gdisp,
else
if (scaledest < 0x10)
scaledest++;
else
return;
break;
case ZOOMOUT :
@ -121,6 +123,8 @@ change_scale (GDisplay *gdisp,
else
if (scalesrc < 0x10)
scalesrc++;
else
return;
break;
default :

View file

@ -113,6 +113,8 @@ change_scale (GDisplay *gdisp,
else
if (scaledest < 0x10)
scaledest++;
else
return;
break;
case ZOOMOUT :
@ -121,6 +123,8 @@ change_scale (GDisplay *gdisp,
else
if (scalesrc < 0x10)
scalesrc++;
else
return;
break;
default :

View file

@ -4691,6 +4691,10 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
buf[i] = (guchar *)g_malloc (src->w * sizeof(guchar));
}
buffer = g_malloc ((src->w+2*xradius + 1)*(yradius+1));
if (edge_lock)
memset(buffer, 255, (src->w+2*xradius + 1)*(yradius+1));
else
memset(buffer, 0, (src->w+2*xradius + 1)*(yradius+1));
for (i = 0; i < src->w+2*xradius; i++)
{
if (i < xradius)
@ -4705,8 +4709,6 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
max[i] = &buffer[(yradius+1)*(src->w + xradius - 1)];
else
max[i] = &buffer[(yradius+1)*(src->w + xradius)];
for (j = 0 ; j < xradius+1; j++)
max[i][j] = 255;
}
if (!edge_lock)
for (j = 0 ; j < xradius+1; j++)
@ -4723,7 +4725,7 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
if (edge_lock)
memcpy (buf[0], buf[1], src->w);
else
memset(buf[0], 0, src->w);
memset (buf[0], 0, src->w);
for (x = 0; x < src->w; x++) /* set up max for top of image */
{
max[x][0] = buf[0][x];

View file

@ -4691,6 +4691,10 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
buf[i] = (guchar *)g_malloc (src->w * sizeof(guchar));
}
buffer = g_malloc ((src->w+2*xradius + 1)*(yradius+1));
if (edge_lock)
memset(buffer, 255, (src->w+2*xradius + 1)*(yradius+1));
else
memset(buffer, 0, (src->w+2*xradius + 1)*(yradius+1));
for (i = 0; i < src->w+2*xradius; i++)
{
if (i < xradius)
@ -4705,8 +4709,6 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
max[i] = &buffer[(yradius+1)*(src->w + xradius - 1)];
else
max[i] = &buffer[(yradius+1)*(src->w + xradius)];
for (j = 0 ; j < xradius+1; j++)
max[i][j] = 255;
}
if (!edge_lock)
for (j = 0 ; j < xradius+1; j++)
@ -4723,7 +4725,7 @@ thin_region(PixelRegion *src, gint16 xradius, gint16 yradius, int edge_lock)
if (edge_lock)
memcpy (buf[0], buf[1], src->w);
else
memset(buf[0], 0, src->w);
memset (buf[0], 0, src->w);
for (x = 0; x < src->w; x++) /* set up max for top of image */
{
max[x][0] = buf[0][x];

View file

@ -113,6 +113,8 @@ change_scale (GDisplay *gdisp,
else
if (scaledest < 0x10)
scaledest++;
else
return;
break;
case ZOOMOUT :
@ -121,6 +123,8 @@ change_scale (GDisplay *gdisp,
else
if (scalesrc < 0x10)
scalesrc++;
else
return;
break;
default :