Commit Graph

14 Commits

Author SHA1 Message Date
Márk Tolmács 8d7ffa21d1 Merge branch 'master' into mtolmacs/fix/small-elbow-routing 2025-05-02 09:47:18 +02:00
Ryan Di 195a743874 feat: switch between basic shapes (#9270)
* feat: switch between basic shapes

* add tab for testing

* style tweaks

* only show hint when a new node is created

* fix panel state

* refactor

* combine captures into one

* keep original font size

* switch multi

* switch different types altogether

* use tab only

* fix font size atom

* do not switch from active tool change

* prefer generic when mixed

* provide an optional direction when shape switching

* adjust panel bg & shadow

* redraw to correctly position text

* remove redundant code

* only tab to switch if focusing on app container

* limit which linear elements can be switched

* add shape switch to command palette

* remove hint

* cache initial panel position

* bend line to elbow if needed

* remove debug logic

* clean switch of arrows using app state

* safe conversion between line, sharp, curved, and elbow

* cache linear when panel shows up

* type safe element conversion

* rename type

* respect initial type when switching between linears

* fix elbow segment indexing

* use latest linear

* merge converted elbow points if too close

* focus on panel after click

* set roudness to null to fix drag points offset for elbows

* remove Mutable

* add arrowBoundToElement check

* make it dependent on one signle state

* unmount when not showing

* simpler types, tidy up code

* can change linear when it's linear + non-generic

* fix popup component lifecycle

* move constant to CLASSES

* DRY out type detection

* file & variable renaming

* refactor

* throw in not-prod instead

* simplify

* semi-fix bindings on `generic` type conversion

---------

Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
2025-04-30 18:07:31 +02:00
Mark Tolmacs 9a2bd18904 Further adjustments for edge cases 2025-04-25 18:54:18 +02:00
Márk Tolmács 9c27f936de Merge branch 'master' into mtolmacs/fix/small-elbow-routing 2025-04-25 14:27:15 +02:00
Mark Tolmacs b8fdd7ef23 Remove unneeded imports 2025-04-25 14:26:01 +02:00
Mark Tolmacs ece841326b Refine corner avoidance 2025-04-25 14:25:40 +02:00
Narek Malkhasyan 2a0d15799c fix: when dragging arrow endpoint, update binding only on the dragged side (#9367) 2025-04-25 10:46:58 +02:00
Marcel Mraz 1913599594 refactor: remove dependency on the (static) Scene (#9389) 2025-04-23 13:45:08 +02:00
Márk Tolmács bc9f34e71e Merge branch 'master' into mtolmacs/fix/small-elbow-routing 2025-04-21 12:30:49 +02:00
David Luzar a5d6939826 fix: keep orig elem in place on alt-duplication (#9403)
* fix: keep orig elem in place on alt-duplication

* clarify comment

* fix: incorrect selection on duplicating labeled containers

* fix: duplicating within group outside frame should remove from group
2025-04-17 16:08:07 +02:00
Mark Tolmacs a8338cdb5a More adaptive elbow dongle offset 2025-04-11 21:08:55 +02:00
jhanma17dev dff69e9191 chore: Element center point util (#9298) 2025-04-09 17:04:51 +02:00
David Luzar c2caf78e95 fix: deselected hit element being duplicated + incorrect re-seeding (#9333)
* fix: deselected hit element being duplicated + incorrect re-seeding

* snapshots

* Fix alt-drag binding

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

* Add alt-drag bound arrow test

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>

---------

Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
2025-04-07 10:41:31 +02:00
Marcel Mraz 432a46ef9e refactor: separate elements logic into a standalone package (#9285) 2025-03-26 15:24:59 +01:00