if (!st) return FALSE;
- x1 = (pr->x_scroll / PR_TILE_SIZE) * PR_TILE_SIZE;
- y1 = (pr->y_scroll / PR_TILE_SIZE) * PR_TILE_SIZE;
- x2 = ((pr->x_scroll + pr->vis_width) / PR_TILE_SIZE) * PR_TILE_SIZE + PR_TILE_SIZE;
- y2 = ((pr->y_scroll + pr->vis_height) / PR_TILE_SIZE) * PR_TILE_SIZE + PR_TILE_SIZE;
+ x1 = (pr->x_scroll / pr->tile_width) * pr->tile_width;
+ y1 = (pr->y_scroll / pr->tile_height) * pr->tile_height;
+ x2 = ((pr->x_scroll + pr->vis_width) / pr->tile_width) * pr->tile_width + pr->tile_width;
+ y2 = ((pr->y_scroll + pr->vis_height) / pr->tile_height) * pr->tile_height + pr->tile_height;
return !((double)st->x * pr->scale > (double)x2 ||
(double)(st->x + pr->source_tile_width) * pr->scale < (double)x1 ||
{
gint tiles;
- tiles = (pr->vis_width / PR_TILE_SIZE + 1) * (pr->vis_width / PR_TILE_SIZE + 1);
- tile_max = MAX(tiles * PR_TILE_SIZE * PR_TILE_SIZE * 3,
+ tiles = (pr->vis_width / pr->tile_width + 1) * (pr->vis_height / pr->tile_height + 1);
+ tile_max = MAX(tiles * pr->tile_width * pr->tile_height * 3,
(gint)((double)pr->tile_cache_max * 1048576.0 * pr->scale));
}
else
static gint pr_tile_is_visible(PixbufRenderer *pr, ImageTile *it)
{
- return (it->x + it->w >= pr->x_scroll && it->x <= pr->x_scroll + pr->window_width - pr->x_offset * 2 &&
- it->y + it->h >= pr->y_scroll && it->y <= pr->y_scroll + pr->window_height - pr->y_offset * 2);
+ return (it->x + it->w >= pr->x_scroll && it->x < pr->x_scroll + pr->vis_width &&
+ it->y + it->h >= pr->y_scroll && it->y < pr->y_scroll + pr->vis_height);
}
/*
{
ImageTile *it;
- it = pr_tile_get(pr, i, j, only_existing);
+ it = pr_tile_get(pr, i, j,
+ (only_existing &&
+ i + pr->tile_width < pr->x_scroll &&
+ i > pr->x_scroll + pr->vis_width &&
+ j + pr->tile_height < pr->y_scroll &&
+ j > pr->y_scroll +pr->vis_height));
if (it)
{
QueueData *qd;