Taking the absolute value is actually not necessary
This commit is contained in:
parent
b0a38741df
commit
2cac43ef39
@ -54,7 +54,7 @@ module.exports = function (element, axis, value) {
|
|||||||
if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
|
if (axis === 'top' && value >= i.contentHeight - i.containerHeight) {
|
||||||
// don't allow scroll past container
|
// don't allow scroll past container
|
||||||
value = i.contentHeight - i.containerHeight;
|
value = i.contentHeight - i.containerHeight;
|
||||||
if (Math.abs(value - element.scrollTop) <= 1) {
|
if (value - element.scrollTop <= 1) {
|
||||||
// mitigates rounding errors on non-subpixel scroll values
|
// mitigates rounding errors on non-subpixel scroll values
|
||||||
value = element.scrollTop;
|
value = element.scrollTop;
|
||||||
} else {
|
} else {
|
||||||
@ -66,7 +66,7 @@ module.exports = function (element, axis, value) {
|
|||||||
if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
|
if (axis === 'left' && value >= i.contentWidth - i.containerWidth) {
|
||||||
// don't allow scroll past container
|
// don't allow scroll past container
|
||||||
value = i.contentWidth - i.containerWidth;
|
value = i.contentWidth - i.containerWidth;
|
||||||
if (Math.abs(value - element.scrollLeft) <= 1) {
|
if (value - element.scrollLeft <= 1) {
|
||||||
// mitigates rounding errors on non-subpixel scroll values
|
// mitigates rounding errors on non-subpixel scroll values
|
||||||
value = element.scrollLeft;
|
value = element.scrollLeft;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user