[patch] gimp-drawable-get/set-pixel bugfix

1999-11-09 Thread Tamito KAJIYAMA

Hi.

I found a bug that gimp-drawable-get/set-pixel swapped the
specified x and y coordinates when getting/setting a pixel.

I found the bug in 1.1.10 but the bug seems not to be fixed in
1.1.11.  Attached is a patch that fixes the bug.

Regards,

-- 
KAJIYAMA, Tamito [EMAIL PROTECTED]

--- drawable_cmds.c.origThu Oct  7 04:55:27 1999
+++ drawable_cmds.c Mon Nov  8 17:38:15 1999
@@ -1057,7 +1057,7 @@
  x %= TILE_WIDTH;
  y %= TILE_WIDTH;
 
- p = tile_data_pointer (tile, y, x);
+ p = tile_data_pointer (tile, x, y);
  for (b = 0; b  num_channels; b++)
pixel[b] = p[b];
 
@@ -1167,7 +1167,7 @@
  x %= TILE_WIDTH;
  y %= TILE_WIDTH;
 
- p = tile_data_pointer (tile, y, x);
+ p = tile_data_pointer (tile, x, y);
  for (b = 0; b  num_channels; b++)
*p++ = *pixel++;
 



Re: [patch] gimp-drawable-get/set-pixel bugfix

1999-11-09 Thread Austin Donnelly

On Wednesday, 10 Nov 1999, Tamito KAJIYAMA wrote:

 I found a bug that gimp-drawable-get/set-pixel swapped the
 specified x and y coordinates when getting/setting a pixel.

Ouch!

gimp-drawable-{get,set}-pixel is such a slow API not many people use
it, I reckon.  That's probably why it's taken so long to crawl out of
the woodwork.

 --- drawable_cmds.c.orig  Thu Oct  7 04:55:27 1999
 +++ drawable_cmds.c   Mon Nov  8 17:38:15 1999
 @@ -1057,7 +1057,7 @@
 x %= TILE_WIDTH;
 y %= TILE_WIDTH;

This is another bug - if we ever go to non-square tiles this will
break.  It should read:

x %= TILE_WIDTH;
y %= TILE_HEIGHT;

Thanks for bringing this to our attention, good work.

Austin