Fabricjs canvas reset after zooming
I have a fabricjs canvas that I need to be able to zoom in and out and also change the image/object inside several times. For this I setup the canvas in the first time the page loads like this: fabric.Object.prototype.hasBorders = false; fabric.Object.prototype.hasControls = false; canvas = new fabric.Canvas('my_canvas', {renderOnAddRemove: false, stateful: false}); canvas.defaultCursor = "pointer"; canvas.backgroundImageStretch = false; canvas.selection = false; canvas.clear(); var image = document.getElementById('my_image'); if (image != null) { imageSrc = image.src; if(imageSrc.length > 0){