mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-27 23:56:09 +03:00
Compare commits
6 Commits
1fe1630ab9
...
c5c1fd156f
Author | SHA1 | Date | |
---|---|---|---|
|
c5c1fd156f | ||
|
4f990c74b7 | ||
|
845cbced69 | ||
|
05997d359c | ||
|
f85c8ca4e9 | ||
|
5a11784173 |
@ -6,7 +6,7 @@ OPENSEADRAGON CHANGELOG
|
||||
* NEW BEHAVIOR: Setting the viewport rotation now animates by default (pass false for the new immediately parameter to disable) (#2136 @jonasengelmann)
|
||||
* DEPRECATION: Don't access the viewport's degrees property directly anymore; instead use setRotation and getRotation (#2136 @jonasengelmann)
|
||||
* New gesture: Double-click and drag to zoom (on by default for touch) (#2225 @HamzaTatheer)
|
||||
* You can now provide a pivot point when rotating the viewport (#2233 @ pearcetm)
|
||||
* You can now provide a pivot point when rotating the viewport (#2233 #2253 @pearcetm)
|
||||
* Improved the constraints that keep the image in the viewer, specifically when zoomed out a lot (#2160 @joedf, #2246 @pearcetm)
|
||||
* You can now provide an element for the navigator (as an alternative to an ID) (#1303 @cameronbaney, #2166 #2175 @joedf)
|
||||
* Now supporting IIIF "id" and "identifier" in addition to "@id" (#2173 @ahankinson)
|
||||
|
9
package-lock.json
generated
9
package-lock.json
generated
@ -1011,9 +1011,10 @@
|
||||
}
|
||||
},
|
||||
"node_modules/decode-uri-component": {
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
||||
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
@ -7121,7 +7122,9 @@
|
||||
}
|
||||
},
|
||||
"decode-uri-component": {
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
||||
"integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
|
||||
"dev": true
|
||||
},
|
||||
"deep-is": {
|
||||
|
@ -913,17 +913,15 @@ $.Viewport.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Rotates this viewport to the angle specified. Alias for rotateTo.
|
||||
* Rotates this viewport to the angle specified.
|
||||
* @function
|
||||
* @param {Number} degrees The degrees to set the rotation to.
|
||||
* @param {OpenSeadragon.Point} [pivot] (Optional) point in viewport coordinates
|
||||
* around which the rotation should be performed. Defaults to the center of the viewport.
|
||||
* @param {Boolean} [immediately=false] Whether to animate to the new angle
|
||||
* or rotate immediately.
|
||||
* * @returns {OpenSeadragon.Viewport} Chainable.
|
||||
*/
|
||||
setRotation: function(degrees, pivot, immediately) {
|
||||
return this.rotateTo(degrees, pivot, immediately);
|
||||
setRotation: function(degrees, immediately) {
|
||||
return this.rotateTo(degrees, null, immediately);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -938,6 +936,20 @@ $.Viewport.prototype = {
|
||||
this.degreesSpring.target.value;
|
||||
},
|
||||
|
||||
/**
|
||||
* Rotates this viewport to the angle specified around a pivot point. Alias for rotateTo.
|
||||
* @function
|
||||
* @param {Number} degrees The degrees to set the rotation to.
|
||||
* @param {OpenSeadragon.Point} [pivot] (Optional) point in viewport coordinates
|
||||
* around which the rotation should be performed. Defaults to the center of the viewport.
|
||||
* @param {Boolean} [immediately=false] Whether to animate to the new angle
|
||||
* or rotate immediately.
|
||||
* * @returns {OpenSeadragon.Viewport} Chainable.
|
||||
*/
|
||||
setRotationWithPivot: function(degrees, pivot, immediately) {
|
||||
return this.rotateTo(degrees, pivot, immediately);
|
||||
},
|
||||
|
||||
/**
|
||||
* Rotates this viewport to the angle specified.
|
||||
* @function
|
||||
|
@ -46,7 +46,7 @@
|
||||
});
|
||||
|
||||
viewer.addHandler('open', function handler(event) {
|
||||
viewer.viewport.setRotation(30, null, true);
|
||||
viewer.viewport.setRotation(30, true);
|
||||
Util.spyOnce(viewer.drawer.context, 'rotate', function() {
|
||||
assert.ok(true, 'drawing with new rotation');
|
||||
done();
|
||||
|
@ -212,13 +212,13 @@
|
||||
checkPoint(assert, ' after zoom and pan');
|
||||
|
||||
//Restore rotation
|
||||
viewer.viewport.setRotation(0, null, true);
|
||||
viewer.viewport.setRotation(0, true);
|
||||
done();
|
||||
});
|
||||
viewer.viewport.zoomTo(0.8).panTo(new OpenSeadragon.Point(0.1, 0.2));
|
||||
});
|
||||
|
||||
viewer.viewport.setRotation(45, null, true);
|
||||
viewer.viewport.setRotation(45, true);
|
||||
viewer.open([{
|
||||
tileSource: "/test/data/testpattern.dzi"
|
||||
}, {
|
||||
|
@ -247,7 +247,7 @@
|
||||
function openHandler() {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
var viewport = viewer.viewport;
|
||||
viewport.setRotation(-675, null, true);
|
||||
viewport.setRotation(-675, true);
|
||||
Util.assertRectangleEquals(
|
||||
assert,
|
||||
viewport.getHomeBoundsNoRotate(),
|
||||
@ -269,7 +269,7 @@
|
||||
function openHandler() {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
var viewport = viewer.viewport;
|
||||
viewport.setRotation(-675, null, true);
|
||||
viewport.setRotation(-675, true);
|
||||
Util.assertRectangleEquals(
|
||||
assert,
|
||||
viewport.getHomeBounds(),
|
||||
@ -533,7 +533,7 @@
|
||||
var openHandler = function() {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
var viewport = viewer.viewport;
|
||||
viewport.setRotation(45, null, true);
|
||||
viewport.setRotation(45, true);
|
||||
viewport.fitBounds(new OpenSeadragon.Rect(1, 1, 1, 1), true);
|
||||
viewport.applyConstraints(true);
|
||||
var bounds = viewport.getBounds();
|
||||
@ -557,7 +557,7 @@
|
||||
var viewport = viewer.viewport;
|
||||
|
||||
viewport.setFlip(true);
|
||||
viewport.setRotation(45, null, true);
|
||||
viewport.setRotation(45, true);
|
||||
|
||||
viewport.fitBounds(new OpenSeadragon.Rect(1, 1, 1, 1), true);
|
||||
viewport.applyConstraints(true);
|
||||
@ -659,7 +659,7 @@
|
||||
var openHandler = function(event) {
|
||||
viewer.removeHandler('open', openHandler);
|
||||
var viewport = viewer.viewport;
|
||||
viewport.setRotation(45, null, true);
|
||||
viewport.setRotation(45, true);
|
||||
|
||||
for(var i = 0; i < testRectsFitBounds.length; i++){
|
||||
var rect = testRectsFitBounds[i];
|
||||
@ -1066,12 +1066,12 @@
|
||||
var viewport = viewer.viewport;
|
||||
|
||||
assert.propEqual(viewport.getRotation, 0, "Original rotation should be 0 degrees");
|
||||
viewport.setRotation(90, null, true);
|
||||
viewport.setRotation(90, true);
|
||||
assert.propEqual(viewport.getRotation, 90, "Rotation should be 90 degrees");
|
||||
viewport.setRotation(-75, null, true);
|
||||
viewport.setRotation(-75, true);
|
||||
assert.propEqual(viewport.getRotation, -75, "Rotation should be -75 degrees");
|
||||
|
||||
viewport.setRotation(0, null, true);
|
||||
viewport.setRotation(0, true);
|
||||
assert.strictEqual(viewport.getRotation(true), 0, 'viewport has default current rotation');
|
||||
assert.strictEqual(viewport.getRotation(false), 0, 'viewport has default target rotation');
|
||||
|
||||
@ -1079,7 +1079,7 @@
|
||||
assert.strictEqual(viewport.getRotation(true), 0, 'current rotation is not changed');
|
||||
assert.strictEqual(viewport.getRotation(false), 33, 'target rotation is set correctly');
|
||||
|
||||
viewport.setRotation(200, null, true);
|
||||
viewport.setRotation(200, true);
|
||||
assert.strictEqual(viewport.getRotation(true), 200, 'current rotation is set correctly');
|
||||
assert.strictEqual(viewport.getRotation(false), 200, 'target rotation is set correctly');
|
||||
|
||||
@ -1099,9 +1099,9 @@
|
||||
viewport.setFlip(true);
|
||||
|
||||
assert.propEqual(viewport.getRotation, 0, "Original flipped rotation should be 0 degrees");
|
||||
viewport.setRotation(90, null, true);
|
||||
viewport.setRotation(90, true);
|
||||
assert.propEqual(viewport.getRotation, 90, "Flipped rotation should be 90 degrees");
|
||||
viewport.setRotation(-75, null, true);
|
||||
viewport.setRotation(-75, true);
|
||||
assert.propEqual(viewport.getRotation, -75, "Flipped rotation should be -75 degrees");
|
||||
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user