mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-08 08:21:00 +00:00
Optimize _initDimensions to not create off-screen canvas every time. Closes #564
This commit is contained in:
parent
94a4b7b8d6
commit
dce3f6f6ca
1 changed files with 4 additions and 2 deletions
|
|
@ -185,8 +185,10 @@
|
|||
* @method _initDimensions
|
||||
*/
|
||||
_initDimensions: function() {
|
||||
var canvasEl = fabric.util.createCanvasElement();
|
||||
this._render(canvasEl.getContext('2d'));
|
||||
if (!this._ctxForDimensions) {
|
||||
this._ctxForDimensions = fabric.util.createCanvasElement().getContext('2d');
|
||||
}
|
||||
this._render(this._ctxForDimensions);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue