Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda