mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
Moved property from prototype to constructor and renamed private function
This commit is contained in:
parent
ef068e9229
commit
712e3d8dd1
@ -130,6 +130,10 @@ $.Drawer = function( options ) {
|
|||||||
// explicit left-align
|
// explicit left-align
|
||||||
this.container.style.textAlign = "left";
|
this.container.style.textAlign = "left";
|
||||||
this.container.appendChild( this.canvas );
|
this.container.appendChild( this.canvas );
|
||||||
|
|
||||||
|
// Image smoothing for canvas rendering (only if canvas is used).
|
||||||
|
// Canvas default is "true", so this will only be changed if user specified "false".
|
||||||
|
this._imageSmoothingEnabled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @lends OpenSeadragon.Drawer.prototype */
|
/** @lends OpenSeadragon.Drawer.prototype */
|
||||||
@ -254,7 +258,7 @@ $.Drawer.prototype = {
|
|||||||
this.sketchCanvas.width = sketchCanvasSize.x;
|
this.sketchCanvas.width = sketchCanvasSize.x;
|
||||||
this.sketchCanvas.height = sketchCanvasSize.y;
|
this.sketchCanvas.height = sketchCanvasSize.y;
|
||||||
}
|
}
|
||||||
this._setImageSmoothingEnabled();
|
this._updateImageSmoothingEnabled();
|
||||||
}
|
}
|
||||||
this._clear();
|
this._clear();
|
||||||
}
|
}
|
||||||
@ -609,10 +613,6 @@ $.Drawer.prototype = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// private
|
|
||||||
_imageSmoothingEnabled: true,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turns image smoothing on or off for this viewer. Note: Ignored in some (especially older) browsers that do not support this property.
|
* Turns image smoothing on or off for this viewer. Note: Ignored in some (especially older) browsers that do not support this property.
|
||||||
*
|
*
|
||||||
@ -624,13 +624,13 @@ $.Drawer.prototype = {
|
|||||||
setImageSmoothingEnabled: function(imageSmoothingEnabled){
|
setImageSmoothingEnabled: function(imageSmoothingEnabled){
|
||||||
if ( this.useCanvas ) {
|
if ( this.useCanvas ) {
|
||||||
this._imageSmoothingEnabled = imageSmoothingEnabled;
|
this._imageSmoothingEnabled = imageSmoothingEnabled;
|
||||||
this._setImageSmoothingEnabled();
|
this._updateImageSmoothingEnabled();
|
||||||
this.viewer.forceRedraw();
|
this.viewer.forceRedraw();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
_setImageSmoothingEnabled: function(){
|
_updateImageSmoothingEnabled: function(){
|
||||||
var context = this.context;
|
var context = this.context;
|
||||||
context.mozImageSmoothingEnabled = this._imageSmoothingEnabled;
|
context.mozImageSmoothingEnabled = this._imageSmoothingEnabled;
|
||||||
context.webkitImageSmoothingEnabled = this._imageSmoothingEnabled;
|
context.webkitImageSmoothingEnabled = this._imageSmoothingEnabled;
|
||||||
|
Loading…
Reference in New Issue
Block a user