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

[Bug]: Shape indexes are not maintained when creating frame dragging over shapes #2892

Closed
1 task done
ricardo-crespo opened this issue Feb 20, 2024 · 1 comment
Closed
1 task done
Labels
bug Something isn't working

Comments

@ricardo-crespo
Copy link
Contributor

What happened?

It seems that when we drag a frame over shapes to include them, the drawing order changes and doesn't respect any manipulation we've made to put some shapes in front of others

tldraw_bug_frame_order.mov

How can we reproduce the bug?

  1. Create some shapes and change their original indexes positioning some on top of others.
  2. Select frame tool and drag to include the shapes to the newly created frame

What browsers are you seeing the problem on?

Firefox, Chrome, Safari

Contact Details

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ricardo-crespo ricardo-crespo added the bug Something isn't working label Feb 20, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 23, 2024
It looks like enclosing shapes with a new frame did not preserve the
order of the shapes. Also makes framing inside of frames work.

Solves #2892

Before:


https://github.com/tldraw/tldraw/assets/2523721/90da4fc0-92a1-49fe-b658-73842c4ef4c2


After:


https://github.com/tldraw/tldraw/assets/2523721/0558d22e-8216-4d84-8a89-7dd049c37974

### Change Type

- [x] `patch` — Bug fix
- [ ] `minor` — New feature
- [ ] `major` — Breaking change
- [ ] `dependencies` — Changes to package dependencies[^1]
- [ ] `documentation` — Changes to the documentation only[^2]
- [ ] `tests` — Changes to any test code only[^2]
- [ ] `internal` — Any other changes that don't affect the published
package[^2]
- [ ] I don't know

[^1]: publishes a `patch` release, for devDependencies use `internal`
[^2]: will not publish a new version

### Test Plan

1. Add a few shapes.
2. Make sure to change some of their order (example in the gif puts the
last created shape to the back)
3. Create a new frame that encloses these shapes.
4. The order of the shapes should be preseved.

- [ ] Unit Tests
- [ ] End to end tests

### Release Notes

- Fix an issue when framing shapes did not preserve the original order
of the shapes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants