Fixed: More meaning full variable and help text, innerStyle not outer

This commit is contained in:
Richard Benjamin Allen 2024-07-12 20:36:11 +01:00
parent 396fcb33a5
commit 2c5d2eb7c6
2 changed files with 11 additions and 9 deletions

View File

@ -230,8 +230,10 @@
* @property {Boolean} [flipped=false]
* Initial flip state.
*
* @property {Boolean} [overlayContentFlipped=false]
* Initial overlay content flip state.
* @property {Boolean} [overlayFlipReversal=true]
* When the viewport is flipped (by pressing 'f'), the overlay is flipped using ScaleX.
* Normally, this setting (default true) keeps the overlay's content readable by flipping it back.
* To make the content flip with the overlay, set overlayFlipReversal to false.
*
* @property {Number} [minZoomLevel=null]
*
@ -1340,7 +1342,7 @@ function OpenSeadragon( options ){
// INITIAL FLIP STATE
flipped: false,
overlayContentFlipped: false,
overlayFlipReversal: true,
// APPEARANCE
opacity: 1,

View File

@ -270,8 +270,8 @@
this.onDraw(position, size, this.element);
} else {
var style = this.style;
var outerElement = element.firstChild;
var outerStyle = outerElement.style;
var innerElement = element.firstChild;
var innerStyle = innerElement.style;
style.left = position.x + "px";
style.top = position.y + "px";
if (this.width !== null) {
@ -286,19 +286,19 @@
'transform');
if (transformOriginProp && transformProp) {
if (rotate && !viewport.flipped) {
outerStyle[transformProp] = "";
innerStyle[transformProp] = "";
style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = "rotate(" + rotate + "deg)";
} else if (!rotate && viewport.flipped) {
outerStyle[transformProp] = outerScale;
innerStyle[transformProp] = outerScale;
style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = scale;
} else if (rotate && viewport.flipped){
outerStyle[transformProp] = outerScale;
innerStyle[transformProp] = outerScale;
style[transformOriginProp] = this._getTransformOrigin();
style[transformProp] = "rotate(" + rotate + "deg)" + scale;
} else {
outerStyle[transformProp] = "";
innerStyle[transformProp] = "";
style[transformOriginProp] = "";
style[transformProp] = "";
}