ensure backward compatibility

This commit is contained in:
jonasengelmann 2022-04-01 10:06:18 +02:00
parent d62538f42e
commit c16d1e3dff
2 changed files with 16 additions and 4 deletions

View File

@ -378,7 +378,7 @@ $.Viewer = function( options ) {
minZoomLevel: this.minZoomLevel, minZoomLevel: this.minZoomLevel,
maxZoomLevel: this.maxZoomLevel, maxZoomLevel: this.maxZoomLevel,
viewer: this, viewer: this,
degrees: this.degrees, initialDegrees: this.degrees,
flipped: this.flipped, flipped: this.flipped,
navigatorRotate: this.navigatorRotate, navigatorRotate: this.navigatorRotate,
homeFillsViewer: this.homeFillsViewer, homeFillsViewer: this.homeFillsViewer,

View File

@ -107,7 +107,7 @@ $.Viewport = function( options ) {
defaultZoomLevel: $.DEFAULT_SETTINGS.defaultZoomLevel, defaultZoomLevel: $.DEFAULT_SETTINGS.defaultZoomLevel,
minZoomLevel: $.DEFAULT_SETTINGS.minZoomLevel, minZoomLevel: $.DEFAULT_SETTINGS.minZoomLevel,
maxZoomLevel: $.DEFAULT_SETTINGS.maxZoomLevel, maxZoomLevel: $.DEFAULT_SETTINGS.maxZoomLevel,
degrees: $.DEFAULT_SETTINGS.degrees, initialDegrees: $.DEFAULT_SETTINGS.degrees,
flipped: $.DEFAULT_SETTINGS.flipped, flipped: $.DEFAULT_SETTINGS.flipped,
homeFillsViewer: $.DEFAULT_SETTINGS.homeFillsViewer, homeFillsViewer: $.DEFAULT_SETTINGS.homeFillsViewer,
silenceMultiImageWarnings: $.DEFAULT_SETTINGS.silenceMultiImageWarnings silenceMultiImageWarnings: $.DEFAULT_SETTINGS.silenceMultiImageWarnings
@ -134,11 +134,10 @@ $.Viewport = function( options ) {
}); });
this.degreesSpring = new $.Spring({ this.degreesSpring = new $.Spring({
initial: options.degrees, initial: options.initialDegrees,
springStiffness: this.springStiffness, springStiffness: this.springStiffness,
animationTime: this.animationTime animationTime: this.animationTime
}); });
delete options.degrees;
this._oldCenterX = this.centerSpringX.current.value; this._oldCenterX = this.centerSpringX.current.value;
this._oldCenterY = this.centerSpringY.current.value; this._oldCenterY = this.centerSpringY.current.value;
@ -153,6 +152,19 @@ $.Viewport = function( options ) {
/** @lends OpenSeadragon.Viewport.prototype */ /** @lends OpenSeadragon.Viewport.prototype */
$.Viewport.prototype = { $.Viewport.prototype = {
// deprecated
get degrees () {
$.console.warn('Accessing [Viewport.degrees] is deprecated. Use viewport.getRotation instead.');
return this.getRotation();
},
// deprecated
set degrees (degrees) {
$.console.warn('Setting [Viewport.degrees] is deprecated. Use viewport.setRotation instead.');
this.setRotation(degrees);
},
/** /**
* Updates the viewport's home bounds and constraints for the given content size. * Updates the viewport's home bounds and constraints for the given content size.
* @function * @function