Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!