Fixed mouse positioning (m2)

This commit is contained in:
Ian Gilman 2015-02-10 11:42:36 -08:00
parent 88c488d706
commit f531a18531

View File

@ -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({