For multi-image open, drawing isn't started until all tileSources have been opened

This commit is contained in:
Ian Gilman 2015-02-10 11:30:36 -08:00
parent 9c2dda6991
commit 88c488d706
2 changed files with 12 additions and 0 deletions

View File

@ -35,6 +35,7 @@ OPENSEADRAGON CHANGELOG
* Rect and Point now have clone functions * Rect and Point now have clone functions
* New Viewport method for managing homeBounds as well as constraints: setHomeBounds * New Viewport method for managing homeBounds as well as constraints: setHomeBounds
* Viewport.open supports positioning config properties * Viewport.open supports positioning config properties
* For multi-image open, drawing isn't started until all tileSources have been opened
* Margins option to push the home region in from the edges of the Viewer (#505) * Margins option to push the home region in from the edges of the Viewer (#505)
* Rect and Point toString() functions are now consistent: rounding values to nearest hundredth * Rect and Point toString() functions are now consistent: rounding values to nearest hundredth
* Overlays appear in the DOM immediately on open or addOverlay (#507) * Overlays appear in the DOM immediately on open or addOverlay (#507)

View File

@ -524,6 +524,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
return; return;
} }
this._opening = true;
var expected = tileSources.length; var expected = tileSources.length;
var successes = 0; var successes = 0;
var failures = 0; var failures = 0;
@ -552,6 +554,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
} }
_this._drawOverlays(); _this._drawOverlays();
_this._opening = false;
/** /**
* Raised when the viewer has opened and loaded one or more TileSources. * Raised when the viewer has opened and loaded one or more TileSources.
@ -566,6 +569,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
// TODO: what if there are multiple sources? // TODO: what if there are multiple sources?
_this.raiseEvent( 'open', { source: source } ); _this.raiseEvent( 'open', { source: source } );
} else { } else {
_this._opening = false;
/** /**
* Raised when an error occurs loading a TileSource. * Raised when an error occurs loading a TileSource.
* *
@ -655,6 +660,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
return this; return this;
} }
this._opening = false;
if ( this.navigator ) { if ( this.navigator ) {
this.navigator.close(); this.navigator.close();
} }
@ -2794,6 +2801,10 @@ function updateOnce( viewer ) {
//viewer.profiler.beginUpdate(); //viewer.profiler.beginUpdate();
if (viewer._opening) {
return;
}
if ( viewer.autoResize ) { if ( viewer.autoResize ) {
var containerSize = _getSafeElemSize( viewer.container ); var containerSize = _getSafeElemSize( viewer.container );
if ( !containerSize.equals( THIS[ viewer.hash ].prevContainerSize ) ) { if ( !containerSize.equals( THIS[ viewer.hash ].prevContainerSize ) ) {