Skip to content

Commit a922e2f

Browse files
Fix: Prevent arrow bend changes when moving groups of shapes (#770)
- Check if only the relation shape is selected before applying bend changes - When multiple shapes are selected together, perform simple translation - Preserves existing behavior when dragging arrow alone (bend changes allowed) - Aligns with tldraw native arrow behavior for group movements Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Trang Doan <trangdoan982@users.noreply.github.com>
1 parent 2fbfcbc commit a922e2f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/obsidian/src/components/canvas/shapes/DiscourseRelationShape.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,13 @@ export class DiscourseRelationUtil extends ShapeUtil<DiscourseRelationShape> {
474474

475475
const bindings = getArrowBindings(this.editor, shape);
476476

477-
// If both ends are bound, convert translation to bend changes instead of moving the arrow
478-
if (bindings.start && bindings.end) {
477+
// Check if other shapes are also being translated
478+
const selectedShapeIds = this.editor.getSelectedShapeIds();
479+
const onlyRelationSelected = selectedShapeIds.length === 1 && selectedShapeIds[0] === shape.id;
480+
481+
// If both ends are bound AND only the relation is selected, convert translation to bend changes
482+
// If other shapes are also selected, do a simple translation instead
483+
if (bindings.start && bindings.end && onlyRelationSelected) {
479484
const shapePageTransform = this.editor.getShapePageTransform(shape.id);
480485
const pageDelta = Vec.Sub(
481486
shapePageTransform.applyToPoint(shape),

0 commit comments

Comments
 (0)