From cb39fb7e3292c127f087f75a514e206db76ae9d8 Mon Sep 17 00:00:00 2001 From: pnorcrss Date: Wed, 31 Jul 2013 14:01:46 -0500 Subject: [PATCH] fixed _getSafeElemSize() --- src/viewer.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index ecb22a19..80b16dd2 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1113,9 +1113,13 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, * @return {[NaN]} * @private */ -function _getSafeElemSize () { - var _nElementSize = $.getElementSize(); - return isNaN(_nElementSize) ? 0 : _nElementSize; +function _getSafeElemSize (oElement) { + var _oElementSize = $.getElementSize(oElement); + + return new $.Point ( + ( _oElementSize.x === 0 ? 1 : _oElementSize.x ), + ( _oElementSize.y === 0 ? 1 : _oElementSize.y ) + ); } /**