[pull] main from tldraw:main#558
Merged
Merged
Conversation
Closes #8857 Deleting a shape in a group made the reparenting to repop the group at a different z-index, this should not happen and the group should keep the same index it previously owned ### Change type - [x] `bugfix` - [ ] `improvement` - [ ] `feature` - [ ] `api` - [ ] `other` ### Test plan Described in #8857 - [ ] Unit tests - [ ] End to end tests ### Release notes - Fixed an issue with deleting shapes in a group that caused a reparenting of the group at a different z-index
In order to let users right-click page items in the page menu without accidentally starting a drag-to-reorder gesture, this PR ignores non-primary buttons on the page item drag handle and wires the page item's `onContextMenu` to open the per-item submenu. The open submenu is tracked through the editor menu manager so it closes together with the page menu. ### Change type - [x] `bugfix` ### Test plan 1. Open the page menu with multiple pages. 2. Right-click on a page item. 3. Confirm the page item's submenu opens (duplicate, move up/down, delete, etc.). 4. Confirm the pages are not reordered as a result of the right-click. 5. Close the page menu and confirm any open per-item submenu is also closed. - [x] End to end tests ### Release notes - Fixed a bug where right-clicking a page item in the page menu could start a drag-to-reorder gesture instead of opening the item's submenu. ### API changes - none ### Code changes | Section | LOC change | | --------- | ---------- | | Core code | +40 / -1 | | Tests | +18 / -0 |
In order to stop edge resize handles from stealing hits near the corners (#8840), this PR bounds the edge and rotate handle hit geometry in `SelectionForegroundOverlayUtil`. Edge handles were modeled as unfilled `Edge2d` lines, which the `OverlayManager` inflates by the global `hitTestMargin` (8/zoom on each side). That made the edge hit band wider than the corner box (≈6.75/zoom half-extent), so the edge won hit tests right at the corner. Edges are now bounded filled `Polygon2d` rectangles matching the pre-overlay dimensions (`targetSize` per side, ≈4.5/zoom), restoring the corner-wins-near-corners behavior. The rotate handle radius is also set to exactly half the corner box width. ### Change type - [x] `bugfix` ### Test plan 1. Select a shape and move the pointer just outside a corner — the corner resize cursor should win over the edge cursor. 2. Hover the middle of an edge — the edge resize handle should still be reachable. 3. Hover a rotate corner — its circular hit area should be half the corner box width. - [x] Unit tests ### Release notes - Fix selection edge resize handles overlapping corner handles, which made corners hard to grab on small shapes. ### Code changes | Section | LOC change | | --------- | ---------- | | Core code | +15 / -14 | | Tests | +7 / -7 | Closes #8840 Relates to #8839
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )