Return early in drawDebugInfo

This commit is contained in:
Philip Giuliani 2015-04-15 13:40:12 +02:00
parent 21d32b59f5
commit 9df77ee915

View File

@ -318,7 +318,10 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{
// private // private
drawDebugInfo: function( tile, count, i ){ drawDebugInfo: function( tile, count, i ){
if ( this.useCanvas ) { if ( !this.useCanvas ) {
return;
}
this.context.save(); this.context.save();
this.context.lineWidth = 2 * $.pixelDensityRatio; this.context.lineWidth = 2 * $.pixelDensityRatio;
this.context.font = 'small-caps bold ' + (13 * $.pixelDensityRatio) + 'px arial'; this.context.font = 'small-caps bold ' + (13 * $.pixelDensityRatio) + 'px arial';
@ -391,7 +394,6 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{
this._restoreRotationChanges( tile, this.canvas, this.context ); this._restoreRotationChanges( tile, this.canvas, this.context );
} }
this.context.restore(); this.context.restore();
}
}, },
// private // private