Skip to content

Commit

Permalink
Provided an ability to select multiple arrow labels using ctrl/cmd key (
Browse files Browse the repository at this point in the history
tldraw#5161)

This PR solves the issue tldraw#5065. It makes it possible to select multiple
arrow descriptions using the cmd key, which was impossible before.


https://github.com/user-attachments/assets/193ee887-1011-481d-b2d3-16dfa753c0fc

### Change type

- [x] `bugfix`
- [ ] `improvement`
- [ ] `feature`
- [ ] `api`
- [ ] `other`

### Release notes

- Provided an ability to select multiple arrow labels using ctrl/cmd key
  • Loading branch information
melnikkk authored Jan 8, 2025
1 parent ae594c6 commit 4569e7d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ export class PointingArrowLabel extends StateNode {
this._labelDragOffset = Vec.Sub(labelGeometry.center, pointInShapeSpace)

this.markId = this.editor.markHistoryStoppingPoint('label-drag start')

const additiveSelectionKey = info.shiftKey || info.accelKey
if (additiveSelectionKey) {
const selectedShapeIds = this.editor.getSelectedShapeIds()
this.editor.setSelectedShapes([...selectedShapeIds, this.shapeId])

return
}

this.editor.setSelectedShapes([this.shapeId])
}

Expand Down

0 comments on commit 4569e7d

Please sign in to comment.