Added willReadFrequently attribute

This commit is contained in:
Nicola 2022-10-24 12:40:34 +02:00
parent dca2748a4e
commit 9e250c015e
2 changed files with 4 additions and 0 deletions

View File

@ -73,6 +73,9 @@ const FileManager = (() => {
let emptyCanvas = document.createElement("canvas");
let layersCopy = currFile.layers.slice();
exportCanvas.getContext("2d").willReadFrequently = true;
emptyCanvas.getContext("2d").willReadFrequently = true;
exportCanvas.width = currFile.canvasSize[0];
exportCanvas.height = currFile.canvasSize[1];

View File

@ -63,6 +63,7 @@ const LayerList = (() => {
// Creating a layer object
let newLayer = new Layer(currFile.canvasSize[0], currFile.canvasSize[1], newCanvas, toAppend);
newLayer.context.fillStyle = currFile.currentLayer.context.fillStyle;
newLayer.context.willReadFrequently = true;
newLayer.copyData(currFile.currentLayer);
// currFile.layers.splice(index, 0, newLayer);