fix by sjburges to fix grid on selections. --matt

Sat May 30 02:03:19 EDT 1998  Matthew Wilson  <msw@gimp.org>

	* plug-ins/grid/grid.c: fix by sjburges to fix grid on selections.
--matt
This commit is contained in:
EDT 1998 Matthew Wilson
1998-05-30 06:05:09 +00:00
committed by Matt Wilson
parent a656b146e5
commit 9bb6ea8994
3 changed files with 20 additions and 14 deletions

View File

@ -1,3 +1,7 @@
Sat May 30 02:03:19 EDT 1998 Matthew Wilson <msw@gimp.org>
* plug-ins/grid/grid.c: fix by sjburges to fix grid on selections.
Fri May 29 23:34:07 EDT 1998 Matthew Wilson <msw@gimp.org> Fri May 29 23:34:07 EDT 1998 Matthew Wilson <msw@gimp.org>
* plug-ins/gaus_iir/gauss_iir.c: fix by sjburges to fix horiz * plug-ins/gaus_iir/gauss_iir.c: fix by sjburges to fix horiz

View File

@ -191,7 +191,7 @@ doit (GDrawable * drawable)
height = drawable->height; height = drawable->height;
bytes = drawable->bpp; bytes = drawable->bpp;
if (gimp_drawable_has_alpha (drawable->id)) if (gimp_drawable_has_alpha (drawable->id))
{ {
color[bytes - 1] = 0xff; color[bytes - 1] = 0xff;
} }
@ -202,33 +202,34 @@ doit (GDrawable * drawable)
/* First off, copy the old one to the new one. */ /* First off, copy the old one to the new one. */
copybuf = malloc (width * bytes); copybuf = malloc (width * bytes);
for (h = sy1; h < sy2; h++) for (h = sy1; h < sy2; h++)
{ {
gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, width); gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, (sx2-sx1));
if ((h - my_config.y_offset) % my_config.height == 0) if ((h - my_config.y_offset) % my_config.height == 0)
{ { /* Draw row */
for (w = sx1; w < sx2; w++) for (w = sx1; w < sx2; w++)
{ {
for (b = 0; b < bytes; b++) for (b = 0; b < bytes; b++)
{ {
copybuf[w * bytes + b] = color[b]; copybuf[(w-sx1) * bytes + b] = color[b];
} }
} }
} }
else else
{ { /* Just copy shit */
for (w = sx1; w < sx2; w++) for (w = sx1; w < sx2; w++)
{ {
if ((w - my_config.x_offset) % my_config.width == 0) if ((w - my_config.x_offset) % my_config.width == 0)
{ {
for (b = 0; b < bytes; b++) for (b = 0; b < bytes; b++)
{ {
copybuf[w * bytes + b] = color[b]; copybuf[(w-sx1) * bytes + b] = color[b];
} }
} }
} }
} }
gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h, width); gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h , (sx2-sx1) );
gimp_progress_update ((double) h / (double) (sy2 - sy1)); gimp_progress_update ((double) h / (double) (sy2 - sy1));
} }
free (copybuf); free (copybuf);

View File

@ -191,7 +191,7 @@ doit (GDrawable * drawable)
height = drawable->height; height = drawable->height;
bytes = drawable->bpp; bytes = drawable->bpp;
if (gimp_drawable_has_alpha (drawable->id)) if (gimp_drawable_has_alpha (drawable->id))
{ {
color[bytes - 1] = 0xff; color[bytes - 1] = 0xff;
} }
@ -202,33 +202,34 @@ doit (GDrawable * drawable)
/* First off, copy the old one to the new one. */ /* First off, copy the old one to the new one. */
copybuf = malloc (width * bytes); copybuf = malloc (width * bytes);
for (h = sy1; h < sy2; h++) for (h = sy1; h < sy2; h++)
{ {
gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, width); gimp_pixel_rgn_get_row (&srcPR, copybuf, sx1, h, (sx2-sx1));
if ((h - my_config.y_offset) % my_config.height == 0) if ((h - my_config.y_offset) % my_config.height == 0)
{ { /* Draw row */
for (w = sx1; w < sx2; w++) for (w = sx1; w < sx2; w++)
{ {
for (b = 0; b < bytes; b++) for (b = 0; b < bytes; b++)
{ {
copybuf[w * bytes + b] = color[b]; copybuf[(w-sx1) * bytes + b] = color[b];
} }
} }
} }
else else
{ { /* Just copy shit */
for (w = sx1; w < sx2; w++) for (w = sx1; w < sx2; w++)
{ {
if ((w - my_config.x_offset) % my_config.width == 0) if ((w - my_config.x_offset) % my_config.width == 0)
{ {
for (b = 0; b < bytes; b++) for (b = 0; b < bytes; b++)
{ {
copybuf[w * bytes + b] = color[b]; copybuf[(w-sx1) * bytes + b] = color[b];
} }
} }
} }
} }
gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h, width); gimp_pixel_rgn_set_row (&destPR, copybuf, sx1, h , (sx2-sx1) );
gimp_progress_update ((double) h / (double) (sy2 - sy1)); gimp_progress_update ((double) h / (double) (sy2 - sy1));
} }
free (copybuf); free (copybuf);