From c1772466758c0184059df411069caa955e8d9f9c Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 4 Mar 2024 21:28:12 -0500 Subject: [PATCH 1/3] fix #2490 --- src/navigator.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/navigator.js b/src/navigator.js index 6a213624..9dafde3e 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -309,6 +309,7 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* this.oldContainerSize = containerSize; this.world.update(); this.world.draw(); + this.update(this.viewer.viewport); } } }, From 2cb1835533ac7e77efafcb89cab6352a37d6b216 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 4 Mar 2024 21:32:14 -0500 Subject: [PATCH 2/3] fix docs --- src/navigator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/navigator.js b/src/navigator.js index 9dafde3e..32868d07 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -356,7 +356,7 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* /** * Used to update the navigator minimap's viewport rectangle when a change in the viewer's viewport occurs. * @function - * @param {OpenSeadragon.Viewport} The viewport this navigator is tracking. + * @param {OpenSeadragon.Viewport} viewport The viewport this navigator is tracking. */ update: function( viewport ) { From 3e04c8854e110c9ea525c18097506a9da512a390 Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 5 Mar 2024 13:01:42 -0500 Subject: [PATCH 3/3] make navigator.update's parameter optional, default to navigator.viewer.viewport --- src/navigator.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/navigator.js b/src/navigator.js index 32868d07..fb95e4b1 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -356,7 +356,7 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* /** * Used to update the navigator minimap's viewport rectangle when a change in the viewer's viewport occurs. * @function - * @param {OpenSeadragon.Viewport} viewport The viewport this navigator is tracking. + * @param {OpenSeadragon.Viewport} [viewport] The viewport to display. Default: the viewport this navigator is tracking. */ update: function( viewport ) { @@ -367,6 +367,10 @@ $.extend( $.Navigator.prototype, $.EventSource.prototype, $.Viewer.prototype, /* topleft, bottomright; + if(!viewport){ + viewport = this.viewer.viewport; + } + viewerSize = $.getElementSize( this.viewer.element ); if ( this._resizeWithViewer && viewerSize.x && viewerSize.y && !viewerSize.equals( this.oldViewerSize ) ) { this.oldViewerSize = viewerSize;