I am using FabricJS and have problem when getting data from canvas. Code is simple:
const canvas = new fabric.Canvas('canvas', {
backgroundColor: "#fff",
preserveObjectStacking: true,
});
canvas.loadFromJSON(saved_data);
var canvas_data = canvas.toObject();
Variable saved_data
contains canvas data with images which have absolute URLs. However when I get canvas data back using canvas.toObject()
image URLs are relative. Since these images are from different domains, they are not found next time these data are loaded again from database.
I couldn’t find any configuration option which would change this behaviour.
Thank you in advance for any help.