I'm running a platform where users have the ability to manipulate images within a Fabric.js canvas. My goal is to replicate their "design" on a larger canvas, so I'm wondering what methods exist for recreating a canvas using the original variables?
Currently, my approach involves using JSON.stringify(canvas);
to extract the data. However, this method requires copying and pasting all the variables manually, which is not quite efficient. For example:
type":"image","originX":"center","originY":"center","left":135,"top":259,"
. I'd appreciate any suggestions or insights on how to achieve this task more effectively. Is JSON.stringify(canvas);
followed by manual variable duplication really the most straightforward option available?