Add similar refPoint validity check to zoomBy

This commit is contained in:
Jonathan Nielsen 2013-10-04 13:06:25 -06:00
parent fd85ee4f4e
commit ae5acb6547

View File

@ -536,7 +536,7 @@ $.Viewport.prototype = {
* @return {OpenSeadragon.Viewport} Chainable.
*/
zoomBy: function( factor, refPoint, immediately ) {
if( refPoint ) {
if (refPoint instanceof $.Point && !isNaN(refPoint.x) && !isNaN(refPoint.y)) {
refPoint = refPoint.rotate(
-this.degrees,
new $.Point( this.centerSpringX.target.value, this.centerSpringY.target.value )