javascript - fabric.js - Multiuser canvas -
I'm trying to create a canvas fabric.js, and I'm trying to create a multiuser canvas.
Everything works for now, though there is a problem: Notice erases every time I am using the loadFromJSON () function.
How can I add information to free drawing mode, erasing information?
The canvas is where I currently write data, and canvas 2 is where I need to add data.
Kanwaskon ( "mouse up", function () {console.log ( 'mouse up'); //console.log(JSON.stringify (canvas)); canvas 2. LoadfromJSON (JSON. Strifff (Canvas), Canvas 2. RenderAil.Bind (Canvas 2), Function (O, Object) {fabric.log (O, Object);}); canvas.clair ();});
You can go first in two ways:
canvas2.loadFromJSON (JSON.stringify (canvas), canvas2.renderAll.bind (canvas2), function (o, object) {canvas.clear (); fabric.log (o, object);}); another way: var strCanvasContent = JSON.stringify (canvas) canvas 2.loadframJSON (Stranvas content, canvas 2.rerender.bend (canvas 2 ), Function (O, object) {fabric.log (o, object);}); Canvas.clear ();
Comments
Post a Comment