mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-17 23:33:14 +03:00
Simplifies viewport setFlip function.
This commit is contained in:
parent
c2fd5322e2
commit
ec0f55098a
@ -1549,8 +1549,14 @@ $.Viewport.prototype = {
|
||||
* @return {OpenSeadragon.Viewport} Chainable.
|
||||
*/
|
||||
setFlip: function( state ) {
|
||||
if ( this.flipped != state ) {
|
||||
if ( this.flipped === state ) {
|
||||
return this;
|
||||
}
|
||||
|
||||
this.flipped = state;
|
||||
if(this.viewer.navigator){
|
||||
this.viewer.navigator.setFlip(this.getFlip());
|
||||
}
|
||||
this.viewer.forceRedraw();
|
||||
|
||||
/**
|
||||
@ -1564,14 +1570,6 @@ $.Viewport.prototype = {
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.viewer.raiseEvent('flip', {"flipped": state});
|
||||
} else {
|
||||
this.flipped = state;
|
||||
}
|
||||
|
||||
if(this.viewer.navigator){
|
||||
this.viewer.navigator.setFlip(this.getFlip());
|
||||
}
|
||||
this.viewer.forceRedraw();
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user