mirror of https://github.com/GNOME/gimp.git
draw the intersection on top of the grid. Fixes bug #308754.
2005-06-23 Sven Neumann <sven@gimp.org> * plug-ins/common/grid.c: draw the intersection on top of the grid. Fixes bug #308754.
This commit is contained in:
parent
00f94b6554
commit
a0329dd153
|
@ -1,3 +1,8 @@
|
||||||
|
2005-06-23 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/grid.c: draw the intersection on top of the grid.
|
||||||
|
Fixes bug #308754.
|
||||||
|
|
||||||
2005-06-23 Sven Neumann <sven@gimp.org>
|
2005-06-23 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/shift.c: shift whole rows/columns, instead of
|
* plug-ins/common/shift.c: shift whole rows/columns, instead of
|
||||||
|
|
|
@ -401,6 +401,7 @@ grid (gint32 image_ID,
|
||||||
drawable, 0, 0, sx2 - sx1, sy2 - sy1, FALSE, FALSE);
|
drawable, 0, 0, sx2 - sx1, sy2 - sy1, FALSE, FALSE);
|
||||||
|
|
||||||
dest = g_new (guchar, (sx2 - sx1) * bytes);
|
dest = g_new (guchar, (sx2 - sx1) * bytes);
|
||||||
|
|
||||||
for (y = sy1; y < sy2; y++)
|
for (y = sy1; y < sy2; y++)
|
||||||
{
|
{
|
||||||
gimp_pixel_rgn_get_row (&srcPR, dest, sx1, y, (sx2 - sx1));
|
gimp_pixel_rgn_get_row (&srcPR, dest, sx1, y, (sx2 - sx1));
|
||||||
|
@ -409,15 +410,49 @@ grid (gint32 image_ID,
|
||||||
while (y_offset < 0)
|
while (y_offset < 0)
|
||||||
y_offset += grid_cfg.hspace;
|
y_offset += grid_cfg.hspace;
|
||||||
|
|
||||||
if ((y_offset + (grid_cfg.hwidth / 2)) % grid_cfg.hspace < grid_cfg.hwidth)
|
if ((y_offset +
|
||||||
|
(grid_cfg.hwidth / 2)) % grid_cfg.hspace < grid_cfg.hwidth)
|
||||||
{
|
{
|
||||||
for (x = sx1; x < sx2; x++)
|
for (x = sx1; x < sx2; x++)
|
||||||
{
|
{
|
||||||
pix_composite (&dest[(x-sx1) * bytes], hcolor, bytes, blend, alpha);
|
pix_composite (&dest[(x-sx1) * bytes],
|
||||||
|
hcolor, bytes, blend, alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((y_offset + (grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth)
|
for (x = sx1; x < sx2; x++)
|
||||||
|
{
|
||||||
|
x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
|
||||||
|
while (x_offset < 0)
|
||||||
|
x_offset += grid_cfg.vspace;
|
||||||
|
|
||||||
|
if ((x_offset +
|
||||||
|
(grid_cfg.vwidth / 2)) % grid_cfg.vspace < grid_cfg.vwidth)
|
||||||
|
{
|
||||||
|
pix_composite (&dest[(x-sx1) * bytes],
|
||||||
|
vcolor, bytes, blend, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((x_offset +
|
||||||
|
(grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth
|
||||||
|
&&
|
||||||
|
((y_offset % grid_cfg.hspace >= grid_cfg.ispace
|
||||||
|
&&
|
||||||
|
y_offset % grid_cfg.hspace < grid_cfg.ioffset)
|
||||||
|
||
|
||||||
|
(grid_cfg.hspace -
|
||||||
|
(y_offset % grid_cfg.hspace) >= grid_cfg.ispace
|
||||||
|
&&
|
||||||
|
grid_cfg.hspace -
|
||||||
|
(y_offset % grid_cfg.hspace) < grid_cfg.ioffset)))
|
||||||
|
{
|
||||||
|
pix_composite (&dest[(x-sx1) * bytes],
|
||||||
|
icolor, bytes, blend, alpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((y_offset +
|
||||||
|
(grid_cfg.iwidth / 2)) % grid_cfg.hspace < grid_cfg.iwidth)
|
||||||
{
|
{
|
||||||
for (x = sx1; x < sx2; x++)
|
for (x = sx1; x < sx2; x++)
|
||||||
{
|
{
|
||||||
|
@ -429,39 +464,18 @@ grid (gint32 image_ID,
|
||||||
&&
|
&&
|
||||||
x_offset % grid_cfg.vspace < grid_cfg.ioffset)
|
x_offset % grid_cfg.vspace < grid_cfg.ioffset)
|
||||||
||
|
||
|
||||||
(grid_cfg.vspace - (x_offset % grid_cfg.vspace) >= grid_cfg.ispace
|
(grid_cfg.vspace -
|
||||||
|
(x_offset % grid_cfg.vspace) >= grid_cfg.ispace
|
||||||
&&
|
&&
|
||||||
grid_cfg.vspace - (x_offset % grid_cfg.vspace) < grid_cfg.ioffset))
|
grid_cfg.vspace -
|
||||||
|
(x_offset % grid_cfg.vspace) < grid_cfg.ioffset))
|
||||||
{
|
{
|
||||||
pix_composite (&dest[(x-sx1) * bytes], icolor, bytes, blend, alpha);
|
pix_composite (&dest[(x-sx1) * bytes],
|
||||||
|
icolor, bytes, blend, alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (x = sx1; x < sx2; x++)
|
|
||||||
{
|
|
||||||
x_offset = grid_cfg.vspace + x - grid_cfg.voffset;
|
|
||||||
while (x_offset < 0)
|
|
||||||
x_offset += grid_cfg.vspace;
|
|
||||||
|
|
||||||
if ((x_offset + (grid_cfg.vwidth / 2)) % grid_cfg.vspace < grid_cfg.vwidth)
|
|
||||||
{
|
|
||||||
pix_composite (&dest[(x-sx1) * bytes], vcolor, bytes, blend, alpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((x_offset + (grid_cfg.iwidth / 2)) % grid_cfg.vspace < grid_cfg.iwidth
|
|
||||||
&&
|
|
||||||
((y_offset % grid_cfg.hspace >= grid_cfg.ispace
|
|
||||||
&&
|
|
||||||
y_offset % grid_cfg.hspace < grid_cfg.ioffset)
|
|
||||||
||
|
|
||||||
(grid_cfg.hspace - (y_offset % grid_cfg.hspace) >= grid_cfg.ispace
|
|
||||||
&&
|
|
||||||
grid_cfg.hspace - (y_offset % grid_cfg.hspace) < grid_cfg.ioffset)))
|
|
||||||
{
|
|
||||||
pix_composite (&dest[(x-sx1) * bytes], icolor, bytes, blend, alpha);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (preview)
|
if (preview)
|
||||||
{
|
{
|
||||||
memcpy (buffer + (y - sy1) * (sx2 - sx1) * bytes,
|
memcpy (buffer + (y - sy1) * (sx2 - sx1) * bytes,
|
||||||
|
|
Loading…
Reference in New Issue