From 3161808a9d0ad841072a08d1975784fda62702d3 Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Fri, 19 Mar 2021 16:33:10 +0000 Subject: [PATCH] Add a basic setFlip method to TiledImage This doesn't fully work - even raising a bounds-change doesn't seem to be enough. --- src/tiledimage.js | 10 ++++++++++ test/demo/flipping.html | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index c3712aca..61de4e08 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -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. */ diff --git a/test/demo/flipping.html b/test/demo/flipping.html index 6d5f1469..080d0f68 100644 --- a/test/demo/flipping.html +++ b/test/demo/flipping.html @@ -36,7 +36,7 @@ First
- +
@@ -48,7 +48,7 @@ Second
- +