'Fabric.js: Deactivate all canvas events
I have an issue with deactivating all canvas events in fabric.js. I have in my application two ways where the canvas-data come from. The first way is directly through the localStorage and the other way is through a GET-Request to the Server.
At the first way the function which deactivate the canvas events is working. But on the second way not. I haven't a clue why it is so.
The Canvas-Data from both ways are the same. I can't find any difference.
This is my Function to deactivate the canvas-events:
function deactivateCanvasEvents(canvas){
canvas.forEachObject(object => {
object.selectable = false;
object.evented = false;
});
}
I've debugged it already and have seen that on the second way the function forEachObject doesn't get executed and no objects existing although the objects are on the canvas.
Have anyone an idea how i can solve it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
