From a923c3f09c323a3fbf1d5192c5c4e3c44927f6ca Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Thu, 22 Jan 2015 11:52:08 -0800 Subject: [PATCH] Fixed issues with panning in scroll view (m2) --- test/demo/m2/README.md | 3 +++ test/demo/m2/js/main.js | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/demo/m2/README.md b/test/demo/m2/README.md index ef92c45c..0d16eac8 100644 --- a/test/demo/m2/README.md +++ b/test/demo/m2/README.md @@ -1,4 +1,7 @@ # To Do * Support 400+ page collections +* Choosing between multiple versions of a page +* Detail images overlaid on the page +* Cropped images * Show/hide pages? diff --git a/test/demo/m2/js/main.js b/test/demo/m2/js/main.js index 76448fe0..85bbae3d 100644 --- a/test/demo/m2/js/main.js +++ b/test/demo/m2/js/main.js @@ -57,10 +57,10 @@ }); this.viewer.addHandler('canvas-drag', function() { - if (this.mode === 'scroll') { - var result = this.hitTest(this.viewer.viewport.getCenter()); + if (self.mode === 'scroll') { + var result = self.hitTest(self.viewer.viewport.getCenter()); if (result) { - this.page = result.index; + self.page = result.index; } } }); @@ -267,7 +267,8 @@ } if (x !== center.x || y !== center.y) { - this.viewer.viewport.panTo(new OpenSeadragon.Point(x, y), true); + this.viewer.viewport.centerSpringX.current.value = x; + this.viewer.viewport.centerSpringY.current.value = y; } } },