mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added willReadFrequently attribute
This commit is contained in:
parent
dca2748a4e
commit
9e250c015e
@ -73,6 +73,9 @@ const FileManager = (() => {
|
|||||||
let emptyCanvas = document.createElement("canvas");
|
let emptyCanvas = document.createElement("canvas");
|
||||||
let layersCopy = currFile.layers.slice();
|
let layersCopy = currFile.layers.slice();
|
||||||
|
|
||||||
|
exportCanvas.getContext("2d").willReadFrequently = true;
|
||||||
|
emptyCanvas.getContext("2d").willReadFrequently = true;
|
||||||
|
|
||||||
exportCanvas.width = currFile.canvasSize[0];
|
exportCanvas.width = currFile.canvasSize[0];
|
||||||
exportCanvas.height = currFile.canvasSize[1];
|
exportCanvas.height = currFile.canvasSize[1];
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ const LayerList = (() => {
|
|||||||
// Creating a layer object
|
// Creating a layer object
|
||||||
let newLayer = new Layer(currFile.canvasSize[0], currFile.canvasSize[1], newCanvas, toAppend);
|
let newLayer = new Layer(currFile.canvasSize[0], currFile.canvasSize[1], newCanvas, toAppend);
|
||||||
newLayer.context.fillStyle = currFile.currentLayer.context.fillStyle;
|
newLayer.context.fillStyle = currFile.currentLayer.context.fillStyle;
|
||||||
|
newLayer.context.willReadFrequently = true;
|
||||||
newLayer.copyData(currFile.currentLayer);
|
newLayer.copyData(currFile.currentLayer);
|
||||||
|
|
||||||
// currFile.layers.splice(index, 0, newLayer);
|
// currFile.layers.splice(index, 0, newLayer);
|
||||||
|
Loading…
Reference in New Issue
Block a user