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

Gap is not taken into account to compute sizes in toJSON() #663

Open
vincent-lecrubier-skydio opened this issue Jul 24, 2024 · 0 comments · May be fixed by #771
Open

Gap is not taken into account to compute sizes in toJSON() #663

vincent-lecrubier-skydio opened this issue Jul 24, 2024 · 0 comments · May be fixed by #771

Comments

@vincent-lecrubier-skydio

Describe the bug

When gap=0, the api.fromJSON(api.toJSON()) operation is a no-op, as expected, we restore the layout exactly as it was saved.

But when gap>0, api.toJSON() operation actually changes the sizes (height, width) of elements a little bit (omitting gaps), which causes the api.fromJSON(api.toJSON()) to actually slightly change the layout. Doing this repeatedly (e.g. if the user edits and saves the layout multiple times) ends up changing the layout significantly

To Reproduce

Steps to reproduce the behavior:

  1. have a dockview with gap=20
  2. have a button to call api.fromJSON(api.toJSON())
  3. click the button repeatedly
  4. See error

Expected behavior

api.fromJSON(api.toJSON()) should be a no-op basically, not changing sizes

Screenshots

No issue when gap=0

https://www.loom.com/share/dec0b95292404ffbb858095918ee99df?sid=bdfe41d1-4f72-491e-93d3-9920ab826a60

Issue with gap>0

https://www.loom.com/share/e3bdd197762040eb904c61ea2eb4cb90?sid=bc202fe0-ad47-4ab7-a854-81562e0dc1a4

@mathuo mathuo linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant