From f531a18531aff8fd1889cf65a478cc33f1f19729 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 10 Feb 2015 11:42:36 -0800 Subject: [PATCH] Fixed mouse positioning (m2) --- test/demo/m2/js/main.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/demo/m2/js/main.js b/test/demo/m2/js/main.js index 33af2b5b..0e86b766 100644 --- a/test/demo/m2/js/main.js +++ b/test/demo/m2/js/main.js @@ -93,11 +93,13 @@ }) .mousemove(function(event) { var pixel = new OpenSeadragon.Point(event.clientX, event.clientY); + pixel.y -= self.$scrollCover.position().top; var result = self.hitTest(self.viewer.viewport.pointFromPixel(pixel)); self.updateHover(result ? result.index : -1); }) .click(function(event) { var pixel = new OpenSeadragon.Point(event.clientX, event.clientY); + pixel.y -= self.$scrollCover.position().top; var result = self.hitTest(self.viewer.viewport.pointFromPixel(pixel)); if (result) { self.setMode({