Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

189
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda