Commit 33e3a88
Fix joining paths from different layers with Ctrl+J fails (#3534)
* fix: handle PointId remapping when joining paths from different layers
When using Ctrl+J to join two points from different layers, the operation
failed because PointIds change during merge due to collision resolution.
The fix uses index-based point tracking instead of PointIds:
1. Before merge: Record the index of each selected point in its layer
2. Calculate post-merge indices using the point offset from layer1
3. After merge: Retrieve the actual PointIds at those indices
4. Create the connecting segment using the resolved PointIds
This works because Vector::concat() preserves point ordering during merge,
so we can use exact index arithmetic to find points after remapping.
Fixes #3519
* fix: use position-based lookup when joining paths from different layers
* fix cmd + g group case
* fix check for grouped folder
* add in the single layer inside a group case
* use ApplyPointDelta instead of creating a dummy segment
* Update editor/src/messages/tool/common_functionality/shape_editor.rs
Co-authored-by: James Lindsay <[email protected]>
* Update editor/src/messages/tool/common_functionality/shape_editor.rs
Co-authored-by: James Lindsay <[email protected]>
* encapsulate point connection logic in defer_connect_points_by_position
* reduce tolerance to 1e-6
* remove wrong comments
---------
Co-authored-by: James Lindsay <[email protected]>1 parent d98f19b commit 33e3a88
File tree
2 files changed
+143
-16
lines changed- editor/src/messages/tool
- common_functionality
- tool_messages
2 files changed
+143
-16
lines changedLines changed: 84 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
424 | 486 | | |
425 | 487 | | |
426 | 488 | | |
| |||
447 | 509 | | |
448 | 510 | | |
449 | 511 | | |
| 512 | + | |
450 | 513 | | |
451 | 514 | | |
452 | 515 | | |
453 | 516 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
461 | 534 | | |
462 | | - | |
| 535 | + | |
463 | 536 | | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
472 | 540 | | |
473 | 541 | | |
474 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
| |||
2669 | 2674 | | |
2670 | 2675 | | |
2671 | 2676 | | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
2672 | 2731 | | |
2673 | 2732 | | |
2674 | 2733 | | |
| |||
0 commit comments