From 11ef3fcfbb29052a9f67ddd5493c9252c7924091 Mon Sep 17 00:00:00 2001 From: superbland Date: Sat, 9 Oct 2021 15:45:19 +0100 Subject: [PATCH 01/16] Add utility method for getting relative size --- src/tiledimage.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tiledimage.js b/src/tiledimage.js index 82e35ed7..d6e8025b 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -419,6 +419,13 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag return new $.Point(this.source.dimensions.x, this.source.dimensions.y); }, + /** + * @returns {OpenSeadragon.Point} The dimensions of the image as it would be currently rendered in the viewport + */ + getRelativeSize: function() { + return this.getContentSize().times(this.viewport.getZoom()); + }, + // private _viewportToImageDelta: function( viewerX, viewerY, current ) { var scale = (current ? this._scaleSpring.current.value : this._scaleSpring.target.value); From 45bdd87224354865494cf9aab4cdd428213227eb Mon Sep 17 00:00:00 2001 From: superbland Date: Sat, 9 Oct 2021 15:45:51 +0100 Subject: [PATCH 02/16] Tests for getRelativeSize --- test/modules/tiledimage.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/modules/tiledimage.js b/test/modules/tiledimage.js index 46860648..49f40d45 100644 --- a/test/modules/tiledimage.js +++ b/test/modules/tiledimage.js @@ -41,8 +41,11 @@ viewer.addHandler('open', function(event) { var image = viewer.world.getItemAt(0); var contentSize = image.getContentSize(); + var relativeSize = image.getRelativeSize(); assert.equal(contentSize.x, 500, 'contentSize.x'); assert.equal(contentSize.y, 2000, 'contentSize.y'); + assert.equal(relativeSize.x, 12.5, 'relativeSize.x'); + assert.equal(relativeSize.y, 50, 'relativeSize.y'); checkBounds(assert, image, new OpenSeadragon.Rect(5, 6, 10, 40), 'initial bounds'); @@ -74,7 +77,18 @@ image.setHeight(4); checkBounds(assert, image, new OpenSeadragon.Rect(7, 8, 1, 4), 'bounds after width'); - assert.equal(handlerCount, 1, 'correct number of handlers called'); + viewer.addHandler('zoom', function zoomHandler(event) { + var relativeSize = image.getRelativeSize(); + viewer.removeHandler('zoom', zoomHandler); + handlerCount++; + assert.equal(relativeSize.x, 4000, 'relativeSize.x after zoom'); + assert.equal(relativeSize.y, 16000, 'relativeSize.y after zoom'); + }); + + viewer.viewport.zoomTo(8); + + assert.equal(handlerCount, 2, 'correct number of handlers called'); + done(); }); From 92bcfa5416b1603bedd6b8a9ad2cc7ae0514c858 Mon Sep 17 00:00:00 2001 From: superbland Date: Sat, 30 Oct 2021 15:01:17 +0100 Subject: [PATCH 03/16] Rename method, update logic --- src/tiledimage.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index d6e8025b..8145a4d3 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -420,10 +420,12 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag }, /** - * @returns {OpenSeadragon.Point} The dimensions of the image as it would be currently rendered in the viewport + * @returns {OpenSeadragon.Point} The TiledImage's content size, in window coordinates. */ - getRelativeSize: function() { - return this.getContentSize().times(this.viewport.getZoom()); + getSizeInWindowCoordinates: function() { + var topLeft = this.viewport.imageToWindowCoordinates(new $.Point(0, 0)); + var bottomRight = this.viewport.imageToWindowCoordinates(this.getContentSize()); + return new $.Point(bottomRight.x - topLeft.x, bottomRight.y - topLeft.y); }, // private From 57e97019d9479dc03e0e401b83d09b5ea285c436 Mon Sep 17 00:00:00 2001 From: superbland Date: Sat, 30 Oct 2021 15:01:25 +0100 Subject: [PATCH 04/16] Update tests --- test/modules/tiledimage.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/modules/tiledimage.js b/test/modules/tiledimage.js index 49f40d45..4a075328 100644 --- a/test/modules/tiledimage.js +++ b/test/modules/tiledimage.js @@ -41,11 +41,11 @@ viewer.addHandler('open', function(event) { var image = viewer.world.getItemAt(0); var contentSize = image.getContentSize(); - var relativeSize = image.getRelativeSize(); + var sizeInWindowCoords = image.getSizeInWindowCoordinates(); assert.equal(contentSize.x, 500, 'contentSize.x'); assert.equal(contentSize.y, 2000, 'contentSize.y'); - assert.equal(relativeSize.x, 12.5, 'relativeSize.x'); - assert.equal(relativeSize.y, 50, 'relativeSize.y'); + assert.equal(sizeInWindowCoords.x, 125, 'sizeInWindowCoords.x'); + assert.equal(sizeInWindowCoords.y, 500, 'sizeInWindowCoords.y'); checkBounds(assert, image, new OpenSeadragon.Rect(5, 6, 10, 40), 'initial bounds'); @@ -78,14 +78,14 @@ checkBounds(assert, image, new OpenSeadragon.Rect(7, 8, 1, 4), 'bounds after width'); viewer.addHandler('zoom', function zoomHandler(event) { - var relativeSize = image.getRelativeSize(); + var sizeInWindowCoords = image.getSizeInWindowCoordinates(); viewer.removeHandler('zoom', zoomHandler); handlerCount++; - assert.equal(relativeSize.x, 4000, 'relativeSize.x after zoom'); - assert.equal(relativeSize.y, 16000, 'relativeSize.y after zoom'); + assert.equal(sizeInWindowCoords.x, 4000, 'sizeInWindowCoords.x after zoom'); + assert.equal(sizeInWindowCoords.y, 16000, 'sizeInWindowCoords.y after zoom'); }); - viewer.viewport.zoomTo(8); + viewer.viewport.zoomTo(8, null, true); assert.equal(handlerCount, 2, 'correct number of handlers called'); From 446382f5a17202d9a8a01b03c8edd6b6ef2ca189 Mon Sep 17 00:00:00 2001 From: superbland Date: Thu, 4 Nov 2021 19:43:59 +0000 Subject: [PATCH 05/16] Use correct method for imageToWindowCoordinates --- src/tiledimage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 8145a4d3..95ac4f3c 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -423,8 +423,8 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag * @returns {OpenSeadragon.Point} The TiledImage's content size, in window coordinates. */ getSizeInWindowCoordinates: function() { - var topLeft = this.viewport.imageToWindowCoordinates(new $.Point(0, 0)); - var bottomRight = this.viewport.imageToWindowCoordinates(this.getContentSize()); + var topLeft = this.imageToWindowCoordinates(new $.Point(0, 0)); + var bottomRight = this.imageToWindowCoordinates(this.getContentSize()); return new $.Point(bottomRight.x - topLeft.x, bottomRight.y - topLeft.y); }, From fcca75c57e9707be8a552bb824c8b6f5f899ee75 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Fri, 5 Nov 2021 11:52:48 -0700 Subject: [PATCH 06/16] Changelog for #2049 --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index eaedcd1b..97fd5262 100644 --- a/changelog.txt +++ b/changelog.txt @@ -57,6 +57,7 @@ OPENSEADRAGON CHANGELOG * Fixed a bug where the navigator wouldn't pick up opacity/composite changes made while it is loading (#2018 @crydell) * Explicitly set passive:false for wheel event handlers to suppress console warnings. Fixes #1669 (#2043 @msalsbery) * Viewer's canvas-click events now include an originalTarget property so you can know which element received the click (#2037 @iangilman) +* Added method for getting the size of an image in window coordinates (#2049 @superbland) 2.4.2: From 63a4f877162dbd2ac07762ed70f549697bf6ebf8 Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 9 Nov 2021 21:53:03 +0900 Subject: [PATCH 07/16] Fix getLevelScale to use image dimensions --- src/tilesource.js | 10 +++++++--- test/modules/tilesource.js | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index aab7f134..32f10da8 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -284,10 +284,14 @@ $.TileSource.prototype = { // see https://github.com/openseadragon/openseadragon/issues/22 // we use the tilesources implementation of getLevelScale to generate // a memoized re-implementation - var levelScaleCache = {}, + var maxLevel = Math.ceil( + Math.log( Math.max( this.dimensions.x, this.dimensions.y ) ) / + Math.log( 2 ) + ), + levelScaleCache = {}, i; - for( i = 0; i <= this.maxLevel; i++ ){ - levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i); + for( i = 0; i <= maxLevel; i++ ){ + levelScaleCache[ i ] = 1 / Math.pow(2, maxLevel - i); } this.getLevelScale = function( _level ){ return levelScaleCache[ _level ]; diff --git a/test/modules/tilesource.js b/test/modules/tilesource.js index 0d33f4e5..16fbb292 100644 --- a/test/modules/tilesource.js +++ b/test/modules/tilesource.js @@ -120,4 +120,27 @@ assertTileAtPoint(0, new OpenSeadragon.Point(1, 3033 / 2000), new OpenSeadragon.Point(0, 0)); }); + QUnit.test('changing maxLevel', function(assert) { + var tileSource = new OpenSeadragon.TileSource({ + width: 4096, + height: 4096, + }); + + assert.equal(tileSource.maxLevel, 12, 'The initial max level should be 12.'); + + tileSource.maxLevel = 9; + + function assertLevelScale(level, expected) { + var actual = tileSource.getLevelScale(level); + assert.ok(Math.abs(actual - expected) < Number.EPSILON, "The scale at level " + level + + " should be " + expected.toString() + + " got " + actual.toString()); + } + + assertLevelScale(12, 1); + assertLevelScale(10, 1 / 4); + assertLevelScale(8, 1 / 16); + assertLevelScale(6, 1 / 64); + }); + }()); From f15d5a2bfff22f0caa61430fd2259e48d3ecd71b Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Wed, 17 Nov 2021 15:10:23 -0800 Subject: [PATCH 08/16] Changelog for #2059 --- changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 97fd5262..af542783 100644 --- a/changelog.txt +++ b/changelog.txt @@ -57,7 +57,8 @@ OPENSEADRAGON CHANGELOG * Fixed a bug where the navigator wouldn't pick up opacity/composite changes made while it is loading (#2018 @crydell) * Explicitly set passive:false for wheel event handlers to suppress console warnings. Fixes #1669 (#2043 @msalsbery) * Viewer's canvas-click events now include an originalTarget property so you can know which element received the click (#2037 @iangilman) -* Added method for getting the size of an image in window coordinates (#2049 @superbland) +* Added method for getting the size of an image in window coordinates (#2049 @superbland) +* Fixed an issue with TileSource's getLevelScale that would arise if you changed maxLevel (#2059 @kim-sanghoon) 2.4.2: From c4904fb460538a549c4ece135c857fd92c317f80 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Thu, 18 Nov 2021 13:45:50 -0800 Subject: [PATCH 09/16] No longer firing canvas-drag-end if there is no canvas-drag preceding --- src/mousetracker.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 83c7eafc..e64e7637 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -271,7 +271,10 @@ lastPinchDist: 0, currentPinchDist: 0, lastPinchCenter: null, - currentPinchCenter: null + currentPinchCenter: null, + + // Tracking for drag + sentDragEvent: false }; this.hasGestureHandlers = !!( this.pressHandler || this.nonPrimaryPressHandler || @@ -1446,6 +1449,8 @@ for ( i = 0; i < pointerListCount; i++ ) { delegate.activePointersLists.pop(); } + + delegate.sentDragEvent = false; } /** @@ -3476,7 +3481,7 @@ } // Drag End - if ( tracker.dragEndHandler ) { + if ( tracker.dragEndHandler && delegate.sentDragEvent ) { tracker.dragEndHandler( { eventSource: tracker, @@ -3492,6 +3497,9 @@ ); } + // We want to clear this flag regardless of whether we fired the dragEndHandler + delegate.sentDragEvent = false; + // Click / Double-Click if ( ( tracker.clickHandler || tracker.dblClickHandler ) && updateGPoint.insideElement ) { quick = releaseTime - updateGPoint.contactTime <= tracker.clickTimeThreshold && @@ -3679,6 +3687,7 @@ } ); eventInfo.preventDefault = true; + delegate.sentDragEvent = true; } } else if ( pointsList.contacts === 2 ) { // Move (2 contacts, use center) From 91793ce752090c3e1b5aaaf57cf219af77f00a19 Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:22:41 +0900 Subject: [PATCH 10/16] Revert "Merge pull request #2059 from kim-sanghoon/fix/getLevelScale" This reverts commit 1454ac791a0a2d538a58678374b7829f7c3f1fbb, reversing changes made to fcca75c57e9707be8a552bb824c8b6f5f899ee75. --- src/tilesource.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 32f10da8..aab7f134 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -284,14 +284,10 @@ $.TileSource.prototype = { // see https://github.com/openseadragon/openseadragon/issues/22 // we use the tilesources implementation of getLevelScale to generate // a memoized re-implementation - var maxLevel = Math.ceil( - Math.log( Math.max( this.dimensions.x, this.dimensions.y ) ) / - Math.log( 2 ) - ), - levelScaleCache = {}, + var levelScaleCache = {}, i; - for( i = 0; i <= maxLevel; i++ ){ - levelScaleCache[ i ] = 1 / Math.pow(2, maxLevel - i); + for( i = 0; i <= this.maxLevel; i++ ){ + levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i); } this.getLevelScale = function( _level ){ return levelScaleCache[ _level ]; From de39597c141cdf9e34c8a3b94ae18af4e2db048c Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 23 Nov 2021 16:58:00 +0900 Subject: [PATCH 11/16] Add setMaxLevel to initialize getLevelScale memoization --- src/tilesource.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index aab7f134..78732626 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -219,13 +219,14 @@ $.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLeve this.tileOverlap = options.tileOverlap ? options.tileOverlap : 0; this.minLevel = options.minLevel ? options.minLevel : 0; - this.maxLevel = ( undefined !== options.maxLevel && null !== options.maxLevel ) ? + this.setMaxLevel( ( undefined !== options.maxLevel && null !== options.maxLevel ) ? options.maxLevel : ( ( options.width && options.height ) ? Math.ceil( Math.log( Math.max( options.width, options.height ) ) / Math.log( 2 ) ) : 0 - ); + ) + ); if( this.success && $.isFunction( this.success ) ){ this.success( this ); } @@ -275,24 +276,39 @@ $.TileSource.prototype = { return this._tileHeight; }, + /** + * @function + * @param {Number} level + * @return {OpenSeadragon.TileSource} Chainable. + */ + setMaxLevel: function( level ) { + this.maxLevel = level; + this._memoizeLevelScale( level ); + return this; + }, + /** * @function * @param {Number} level */ getLevelScale: function( level ) { + this._memoizeLevelScale( this.maxLevel ); + return this.getLevelScale( level ); + }, + // private + _memoizeLevelScale: function( level ) { // see https://github.com/openseadragon/openseadragon/issues/22 // we use the tilesources implementation of getLevelScale to generate // a memoized re-implementation var levelScaleCache = {}, i; - for( i = 0; i <= this.maxLevel; i++ ){ - levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i); + for( i = 0; i <= level; i++ ){ + levelScaleCache[ i ] = 1 / Math.pow(2, level - i); } this.getLevelScale = function( _level ){ return levelScaleCache[ _level ]; }; - return this.getLevelScale( level ); }, /** From f8c97143e87248ef4a5567bb79f4b7d93cb72e6c Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 30 Nov 2021 11:40:06 +0900 Subject: [PATCH 12/16] Modify the TileSource constructor and _memoizeLevelScale --- src/tilesource.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 78732626..c6bcd8e4 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -219,14 +219,13 @@ $.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLeve this.tileOverlap = options.tileOverlap ? options.tileOverlap : 0; this.minLevel = options.minLevel ? options.minLevel : 0; - this.setMaxLevel( ( undefined !== options.maxLevel && null !== options.maxLevel ) ? + this.maxLevel = ( undefined !== options.maxLevel && null !== options.maxLevel ) ? options.maxLevel : ( ( options.width && options.height ) ? Math.ceil( Math.log( Math.max( options.width, options.height ) ) / Math.log( 2 ) ) : 0 - ) - ); + ); if( this.success && $.isFunction( this.success ) ){ this.success( this ); } @@ -279,12 +278,10 @@ $.TileSource.prototype = { /** * @function * @param {Number} level - * @return {OpenSeadragon.TileSource} Chainable. */ setMaxLevel: function( level ) { this.maxLevel = level; - this._memoizeLevelScale( level ); - return this; + this._memoizeLevelScale(); }, /** @@ -292,19 +289,21 @@ $.TileSource.prototype = { * @param {Number} level */ getLevelScale: function( level ) { - this._memoizeLevelScale( this.maxLevel ); + // if getLevelScale is not memoized, we generate the memoized version + // at the first call and return the result + this._memoizeLevelScale(); return this.getLevelScale( level ); }, // private - _memoizeLevelScale: function( level ) { + _memoizeLevelScale: function() { // see https://github.com/openseadragon/openseadragon/issues/22 // we use the tilesources implementation of getLevelScale to generate // a memoized re-implementation var levelScaleCache = {}, i; - for( i = 0; i <= level; i++ ){ - levelScaleCache[ i ] = 1 / Math.pow(2, level - i); + for( i = 0; i <= this.maxlevel; i++ ){ + levelScaleCache[ i ] = 1 / Math.pow(2, this.maxlevel - i); } this.getLevelScale = function( _level ){ return levelScaleCache[ _level ]; From 24d5d985482df6c1dd98eb9f962e07a11a6ffc4c Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Tue, 30 Nov 2021 13:23:30 +0900 Subject: [PATCH 13/16] Add the description of setMaxLevel --- src/tilesource.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tilesource.js b/src/tilesource.js index c6bcd8e4..7b5d7acf 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -276,6 +276,10 @@ $.TileSource.prototype = { }, /** + * Set the maxLevel to the given level, and perform the memoization of + * getLevelScale with the new maxLevel. This function can be useful if the + * memoization is required before the first call of getLevelScale, or both + * memoized getLevelScale and maxLevel should be changed accordingly. * @function * @param {Number} level */ From 7686812336a69ea7742f7d73481fa112f1ae7997 Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Wed, 1 Dec 2021 10:01:18 +0900 Subject: [PATCH 14/16] Fix maxLevel typo --- src/tilesource.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tilesource.js b/src/tilesource.js index 7b5d7acf..32df56cf 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -306,8 +306,8 @@ $.TileSource.prototype = { // a memoized re-implementation var levelScaleCache = {}, i; - for( i = 0; i <= this.maxlevel; i++ ){ - levelScaleCache[ i ] = 1 / Math.pow(2, this.maxlevel - i); + for( i = 0; i <= this.maxLevel; i++ ){ + levelScaleCache[ i ] = 1 / Math.pow(2, this.maxLevel - i); } this.getLevelScale = function( _level ){ return levelScaleCache[ _level ]; From 3bde256d62fdb6a64656a4067f7a1f9da6043c1e Mon Sep 17 00:00:00 2001 From: Sanghoon Kim <20144277+kim-sanghoon@users.noreply.github.com> Date: Wed, 1 Dec 2021 10:17:10 +0900 Subject: [PATCH 15/16] Modify the unit test for changing maxLevel --- test/modules/tilesource.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/modules/tilesource.js b/test/modules/tilesource.js index 16fbb292..2f752c4a 100644 --- a/test/modules/tilesource.js +++ b/test/modules/tilesource.js @@ -128,8 +128,6 @@ assert.equal(tileSource.maxLevel, 12, 'The initial max level should be 12.'); - tileSource.maxLevel = 9; - function assertLevelScale(level, expected) { var actual = tileSource.getLevelScale(level); assert.ok(Math.abs(actual - expected) < Number.EPSILON, "The scale at level " + level + @@ -141,6 +139,13 @@ assertLevelScale(10, 1 / 4); assertLevelScale(8, 1 / 16); assertLevelScale(6, 1 / 64); + + tileSource.setMaxLevel(9); + + assertLevelScale(9, 1); + assertLevelScale(7, 1 / 4); + assertLevelScale(5, 1 / 16); + assertLevelScale(3, 1 / 64); }); }()); From c8f4934c8a5f33b15830d9a82e5443a48519db63 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Wed, 1 Dec 2021 11:31:49 -0800 Subject: [PATCH 16/16] Changelog for #2066 --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index af542783..582f2d53 100644 --- a/changelog.txt +++ b/changelog.txt @@ -58,7 +58,7 @@ OPENSEADRAGON CHANGELOG * Explicitly set passive:false for wheel event handlers to suppress console warnings. Fixes #1669 (#2043 @msalsbery) * Viewer's canvas-click events now include an originalTarget property so you can know which element received the click (#2037 @iangilman) * Added method for getting the size of an image in window coordinates (#2049 @superbland) -* Fixed an issue with TileSource's getLevelScale that would arise if you changed maxLevel (#2059 @kim-sanghoon) +* Added a setMaxLevel function to TileSource so you can change its maxLevel if needed (#2059, #2066 @kim-sanghoon) 2.4.2: