Merge pull request #2257 from pearcetm/fix-navigator-tests

Fix navigator tests
This commit is contained in:
Ian Gilman 2022-12-12 14:44:03 -08:00 committed by GitHub
commit 2d713783ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 9 deletions

View File

@ -248,14 +248,8 @@
}; };
var dragNavigatorBackToCenter = function () { var dragNavigatorBackToCenter = function () {
var start = viewer.viewport.getBounds().getTopLeft(), var delta = viewer.viewport.getHomeBounds().getCenter().minus(viewer.viewport.getCenter()).times(displayRegionWidth);
target = new OpenSeadragon.Point(0.5 - viewer.viewport.getBounds().width / 2, simulateNavigatorDrag(viewer.navigator, delta.x, delta.y);
1 / viewer.source.aspectRatio / 2 - viewer.viewport.getBounds().height / 2),
delta = target.minus(start);
if (viewer.source.aspectRatio < 1) {
delta.y *= viewer.source.aspectRatio;
}
simulateNavigatorDrag(viewer.navigator, delta.x * displayRegionWidth, delta.y * displayRegionHeight);
}; };
var resizeElement = function ($element, width, height) { var resizeElement = function ($element, width, height) {

View File

@ -50,6 +50,6 @@
<script src="/test/modules/tilesource-dynamic-url.js"></script> <script src="/test/modules/tilesource-dynamic-url.js"></script>
<!--The navigator tests are the slowest (for now; hopefully they can be sped up) <!--The navigator tests are the slowest (for now; hopefully they can be sped up)
so we put them last. --> so we put them last. -->
<!-- The navigator tests are failing right now, so we have them disabled for the moment <script src="/test/modules/navigator.js"></script> --> <script src="/test/modules/navigator.js"></script>
</body> </body>
</html> </html>