mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-26 03:33:13 +03:00
Compare commits
5 Commits
dd2f132577
...
ae70c88e52
Author | SHA1 | Date | |
---|---|---|---|
|
ae70c88e52 | ||
|
e6341ac1e0 | ||
|
2d713783ba | ||
|
e122f372ba | ||
|
48bcd75f1a |
@ -248,14 +248,8 @@
|
||||
};
|
||||
|
||||
var dragNavigatorBackToCenter = function () {
|
||||
var start = viewer.viewport.getBounds().getTopLeft(),
|
||||
target = new OpenSeadragon.Point(0.5 - viewer.viewport.getBounds().width / 2,
|
||||
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 delta = viewer.viewport.getHomeBounds().getCenter().minus(viewer.viewport.getCenter()).times(displayRegionWidth);
|
||||
simulateNavigatorDrag(viewer.navigator, delta.x, delta.y);
|
||||
};
|
||||
|
||||
var resizeElement = function ($element, width, height) {
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
testLog.reset();
|
||||
|
||||
// eslint-disable-next-line new-cap
|
||||
viewer = OpenSeadragon({
|
||||
id: 'example',
|
||||
prefixUrl: '/build/openseadragon/images/',
|
||||
@ -517,12 +518,17 @@
|
||||
var image = viewer.world.getItemAt(0);
|
||||
assert.equal(image.getFullyLoaded(), false, 'not fully loaded at first');
|
||||
|
||||
// Zoom out enough that we don't start out with all the tiles loaded.
|
||||
viewer.viewport.zoomBy(0.5, null, true);
|
||||
|
||||
var count = 0;
|
||||
|
||||
var fullyLoadedChangeHandler = function(event) {
|
||||
if (count === 0) {
|
||||
assert.equal(event.fullyLoaded, true, 'event includes true fullyLoaded property');
|
||||
assert.equal(image.getFullyLoaded(), true, 'image is fully loaded after event');
|
||||
|
||||
// Zoom in enough that it needs to load some new tiles.
|
||||
viewer.viewport.zoomBy(5, null, true);
|
||||
} else if (count === 1) {
|
||||
assert.equal(event.fullyLoaded, false, 'event includes false fullyLoaded property');
|
||||
|
@ -50,6 +50,6 @@
|
||||
<script src="/test/modules/tilesource-dynamic-url.js"></script>
|
||||
<!--The navigator tests are the slowest (for now; hopefully they can be sped up)
|
||||
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>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user