a couple more interesting off-by-one errors. it appears to work now,

* base/pixel-region.c base/tile-manager.c: a couple more
	interesting off-by-one errors.  it appears to work now, though.
This commit is contained in:
Kelly Martin 2001-11-29 03:31:00 +00:00
parent 4ab85c4048
commit 536747c2cb
3 changed files with 18 additions and 11 deletions

View file

@ -1,3 +1,8 @@
2001-11-28 Kelly Martin <kmartin@pyrzqxgl.org>
* base/pixel-region.c base/tile-manager.c: a couple more
interesting off-by-one errors. it appears to work now, though.
2001-11-28 Kelly Martin <kmartin@pyrzqxgl.org>
* base/pixel-region.c: corrected an off-by-one error, sorry :)

View file

@ -128,7 +128,7 @@ pixel_region_get_row (PixelRegion *PR,
if (subsample == 1)
{
read_pixel_data (PR->tiles, x, y, end-1, y, data, w);
read_pixel_data (PR->tiles, x, y, end-1, y, data, tilebpp);
}
else
{
@ -162,12 +162,14 @@ pixel_region_set_row (PixelRegion *PR,
guchar *data)
{
gint end;
gint bpp;
end = x + w ;
end = x + w;
bpp = tile_manager_bpp (PR->tiles);
pixel_region_get_async (PR, x, y, end, y);
write_pixel_data (PR->tiles, x, y, end-1, y, data, w);
write_pixel_data (PR->tiles, x, y, end-1, y, data, bpp);
}

View file

@ -727,12 +727,12 @@ read_pixel_data (TileManager *tm,
s = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT);
d = buffer + stride * (y - y1) + tm->bpp * (x - x1);
rows = tile_eheight (t) - y % TILE_HEIGHT;
if (rows > (y2 - y))
rows = y2 - y;
if (rows > (y2 - y + 1))
rows = y2 - y + 1;
cols = tile_ewidth (t) - x % TILE_WIDTH;
if (cols > (x2 - x))
cols = x2 - x;
if (cols > (x2 - x + 1))
cols = x2 - x + 1;
srcstride = tile_ewidth (t) * tile_bpp (t);
@ -769,12 +769,12 @@ write_pixel_data (TileManager *tm,
s = buffer + stride * (y - y1) + tm->bpp * (x - x1);
d = tile_data_pointer (t, x % TILE_WIDTH, y % TILE_HEIGHT);
rows = tile_eheight (t) - y % TILE_HEIGHT;
if (rows > (y2 - y))
rows = y2 - y;
if (rows > (y2 - y + 1))
rows = y2 - y + 1;
cols = tile_ewidth (t) - x % TILE_WIDTH;
if (cols > (x2 - x))
cols = x2 - x;
if (cols > (x2 - x + 1))
cols = x2 - x + 1;
dststride = tile_ewidth (t) * tile_bpp (t);