mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-25 07:49:38 +03:00
Avoid a load of repeat operations when panning by greater than viewport size.
This commit is contained in:
parent
d9d7dcb758
commit
305938bb48
@ -202,8 +202,8 @@ fb_pan(fbtk_widget_t *widget,
|
||||
y = fbtk_get_absy(widget);
|
||||
|
||||
/* if the pan exceeds the viewport size just redraw the whole area */
|
||||
if (bwidget->pany > height || bwidget->pany < -height ||
|
||||
bwidget->panx > width || bwidget->panx < -width) {
|
||||
if (bwidget->pany >= height || bwidget->pany <= -height ||
|
||||
bwidget->panx >= width || bwidget->panx <= -width) {
|
||||
|
||||
bwidget->scrolly += bwidget->pany;
|
||||
bwidget->scrollx += bwidget->panx;
|
||||
@ -212,6 +212,8 @@ fb_pan(fbtk_widget_t *widget,
|
||||
/* ensure we don't try to scroll again */
|
||||
bwidget->panx = 0;
|
||||
bwidget->pany = 0;
|
||||
bwidget->pan_required = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bwidget->pany < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user