Closed Radagaisus closed 12 years ago
Hey,
On Mac OS X with Chrome there's a rounding error when trying to stop the window from scrolling when reaching the end of the antiscroll box.
> log y, this.innerEl.scrollTop, this.pane.el.height(), this.innerEl.scrollHeight -0.025 585 299.77777767181396 885
The mousewheel end detection is this:
if ((y > 0 && 0 == this.innerEl.scrollTop) || (y < 0 && (this.innerEl.scrollTop + this.pane.el.height() == this.innerEl.scrollHeight))) { ev.preventDefault(); return false; }
A simple fix for the rounding error:
((y > 0 && 0 == this.innerEl.scrollTop) || (y < 0 && (1+this.innerEl.scrollTop + this.pane.el.height() >= this.innerEl.scrollHeight)))
or:
((y > 0 && 0 == this.innerEl.scrollTop) || (y < 0 && (this.innerEl.scrollTop + Math.round(this.pane.el.height()) >= this.innerEl.scrollHeight)))
This applies to both horizontal and vertical scroll.
Pull request?
Hey,
On Mac OS X with Chrome there's a rounding error when trying to stop the window from scrolling when reaching the end of the antiscroll box.
The mousewheel end detection is this:
A simple fix for the rounding error:
or:
This applies to both horizontal and vertical scroll.