Commit 536747c2 authored by Kelly Martin's avatar Kelly Martin
Browse files

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.
parent 4ab85c40
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 :)
......
......@@ -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);
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment