Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
BUGFIX: while 'elemTopBound' is decimal, the 'isInside' would be fals…
Browse files Browse the repository at this point in the history
…e, and no 'ScrollLink' would be 'active'; (fisshy#112)
  • Loading branch information
HopeLyn authored and fisshy committed Jul 21, 2016
1 parent 5197aaf commit 2f4ff9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/npm/lib/mixins/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ var Helpers = {
}

var offsetY = y - this.props.offset;
var isInside = (offsetY >= elemTopBound && offsetY <= elemBottomBound);
var isOutside = (offsetY < elemTopBound || offsetY > elemBottomBound);
var isInside = (offsetY >= Math.floor(elemTopBound) && offsetY <= Math.floor(elemBottomBound));
var isOutside = (offsetY < Math.floor(elemTopBound) || offsetY > Math.floor(elemBottomBound));
var activeLink = scroller.getActiveLink();

if (isOutside && activeLink === to) {
Expand Down
4 changes: 2 additions & 2 deletions modules/mixins/Helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ var Helpers = {
}

var offsetY = y - this.props.offset;
var isInside = (offsetY >= elemTopBound && offsetY <= elemBottomBound);
var isOutside = (offsetY < elemTopBound || offsetY > elemBottomBound);
var isInside = (offsetY >= Math.floor(elemTopBound) && offsetY <= Math.floor(elemBottomBound));
var isOutside = (offsetY < Math.floor(elemTopBound) || offsetY > Math.floor(elemBottomBound));
var activeLink = scroller.getActiveLink();

if (isOutside && activeLink === to) {
Expand Down

0 comments on commit 2f4ff9c

Please sign in to comment.