'Why does line serialization in Fabric export different vertex coordinates?
Example jsfiddle: https://jsfiddle.net/ryanmalley101/az7c8uxb/7/
var rulerLine = new fabric.Line([100, 200, 300, 400]);
console.log(rulerLine);
console.log(JSON.stringify(rulerLine));
When I just print the rulerLine object I made, the x1, x2, y1, and y2 match what was passed to the Line constructor.
When I print out the JSON serialization, it has 0s for all of those values (the formatting on the jsfiddle is bad but the coordinates are at the end of the console printout).
Why is there this discrepancy? If there's a better way to serialize the Line object so it maintains the properties of the initial console log? I'm even open to using different object types than line that could give me the same effect, other object types seem to serialize better. Happy to provide extra context.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
