Add a basic setFlip method to TiledImage

This doesn't fully work - even raising a bounds-change doesn't seem
to be enough.
This commit is contained in:
Alistair Buxton 2021-03-19 16:33:10 +00:00
parent 53052c8c08
commit 3161808a9d
2 changed files with 12 additions and 2 deletions

View File

@ -859,6 +859,16 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
return !!this.flipped;
},
/**
* @param {Boolean} flip Whether the TiledImage should be flipped before rendering.
* @fires OpenSeadragon.TiledImage.event:bounds-change
*/
setFlip: function(flip) {
this.flipped = !!flip;
this._needsDraw = true;
this._raiseBoundsChange();
},
/**
* @returns {Number} The TiledImage's current opacity.
*/

View File

@ -36,7 +36,7 @@
First
<div class="button">
<input type="checkbox" id="ffirst" onchange="flip(0, this.checked)">
<label for="ffirst">Flip (Not Implemented Yet)</label>
<label for="ffirst">Flip (Partially Implemented)</label>
</div>
<div class="button">
<input type="checkbox" id="rfirst" onchange="rotate(0, this.checked * 45)">
@ -48,7 +48,7 @@
Second
<div class="button">
<input type="checkbox" id="fsecond" onchange="flip(1, this.checked)" checked>
<label for="fsecond">Flip (Not Implemented Yet)</label>
<label for="fsecond">Flip (Partially Implemented)</label>
</div>
<div class="button">
<input type="checkbox" id="rsecond" onchange="rotate(1, this.checked * 45)">