mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-01-31 23:21:42 +03:00
added and implemented _getSafeElemSize()
This commit is contained in:
parent
aa7111aef1
commit
750eafcd2e
@ -1107,6 +1107,17 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* [_getSafeElemSize returns getElementSize(), but refuses to return NaN]
|
||||
* @return {[NaN]}
|
||||
* @private
|
||||
*/
|
||||
function _getSafeElemSize () {
|
||||
var _nElementSize = $.getElementSize();
|
||||
return isNaN(_nElementSize) ? 0 : _nElementSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function
|
||||
* @private
|
||||
@ -1121,7 +1132,7 @@ function openTileSource( viewer, source ) {
|
||||
}
|
||||
|
||||
_this.canvas.innerHTML = "";
|
||||
THIS[ _this.hash ].prevContainerSize = $.getElementSize( _this.container );
|
||||
THIS[ _this.hash ].prevContainerSize = $._getSafeElemSize( _this.container );
|
||||
|
||||
|
||||
if( _this.collectionMode ){
|
||||
@ -1514,7 +1525,7 @@ function updateOnce( viewer ) {
|
||||
|
||||
//viewer.profiler.beginUpdate();
|
||||
|
||||
containerSize = $.getElementSize( viewer.container );
|
||||
containerSize = $._getSafeElemSize( viewer.container );
|
||||
if ( !containerSize.equals( THIS[ viewer.hash ].prevContainerSize ) ) {
|
||||
// maintain image position
|
||||
viewer.viewport.resize( containerSize, true );
|
||||
|
Loading…
x
Reference in New Issue
Block a user