Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line coordinates change when loading object with loadFromJSON #5291

Closed
christian-vorhemus opened this issue Oct 3, 2018 · 4 comments
Closed
Labels
stale Issue marked as stale by the stale bot

Comments

@christian-vorhemus
Copy link

Version

2.4.0

Test Case

https://jsfiddle.net/pmuopyfn/3/

I'm facing the same issue that nikksan has already described here #3289

When you add a line to the canvas and set x1, y1, x2, y2, it works as expected. When you serialize this line in a file and reload it, the x1, y1, x2, y2 coodinates change! You can see this in the console output of the JSFiddle.

My question is: Why is that happening? And if this is intended and not a bug, what's the logic behind it?

@kostasx
Copy link

kostasx commented Dec 12, 2019

Same case fo the latest version: https://jsfiddle.net/wtajvnuy/
@christian-vorhemus Did you manage to solve this issue or find a workaround?

@malipetek
Copy link

There is a function called calcLinePoints changing those values when its being exported to JSON. But I am not sure why it is doing it.

@asturur
Copy link
Member

asturur commented Dec 14, 2019

i m sorry for never answering this. Is not a bug nor a feature.
Is like this, the line looks the same and behave the same, with different numbers.

I plan to overhaul the line at some point, avoiding rectangular bounding boxes for diagonal lines and integrating it in polylines.

@stale
Copy link

stale bot commented Jan 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Jan 25, 2020
@asturur asturur closed this as completed Jan 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue marked as stale by the stale bot
Projects
None yet
Development

No branches or pull requests

4 participants