Skip to content

Commit c7cd9b9

Browse files
author
Michael Johnston
committed
Merge pull request Flipboard#107 from stlk/feature/support-scroll-offsets
Allow canvas to be clickable on pages with scrolling
2 parents 4b31658 + a43ae90 commit c7cd9b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/hitTest.js

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ function hitTest (e, rootLayer, rootNode) {
2121
touchX -= rootNodeBox.left;
2222
touchY -= rootNodeBox.top;
2323
}
24+
25+
touchY = touchY - window.pageYOffset;
26+
touchX = touchX - window.pageXOffset;
2427
return getLayerAtPoint(
2528
rootLayer,
2629
e.type,

0 commit comments

Comments
 (0)