Fix binding
Remove unneeded params
Unfinished simple arrow avoidance
Fix newly created jumping arrow when gets outside
Do not apply the jumping logic to elbow arrows for new elements
Existing arrows now jump out
Type updates to support fixed binding for simple arrows
Fix crash for elbow arrws in mutateElement()
Refactored simple arrow creation
Updating tests
No confirm threshold when inside biding range
Fix multi-point arrow grid off
Make elbow arrows respect grids
Unbind arrow if bound and moved at shaft of arrow key
Fix binding test
Fix drag unbind when the bound element is in the selection
Do not move mid point for simple arrows bound on both ends
Add test for mobing mid points for simple arrows when bound on the same element on both ends
Fix linear editor bug when both midpoint and endpoint is moved
Fix all point multipoint arrow highlight and binding
* fix: awkward point adding and removing on touch device
* feat: move finalize to next to last point
* feat: on touch screen, click would create a default line/arrow
* fix: make default adaptive to zoom
* fix: increase padding to avoid cutoffs
* refactor: simplify
* fix: only use bigger padding when needed
* center arrow horizontally on pointer
* increase min drag distance before we start 2-point-arrow-drag-creating
* do not render 0-width arrow while creating
* dead code
* fix tests
* fix: remove redundant code
* do not enter line editor on creation
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* fix: set cursor to auto when not hovering a point on linear element #9628
* Simplify hover test for cursor
* Add back comment
* Fix test for hit testing
---------
Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
* fix : double click on line enables line editor
* fix : prevent double-click to edit/create text
when inside line editor
* refactor: use lineCheck instead of arrowCheck in
doubleClick handler to align with updated logic
* fix: replace negative arrowCheck with lineCheck in
dbl click handler and fix double-click bind text
test in linearElementEditor tests
* clean up test
* simplify check
* add tests
* prevent text editing on dblclick when inside arrow editor
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* Loop Lock/Unlock
* fixed condition. 4 line points are required for the action to be available
* extracted updateLoopLock to improve readability. Removed unnecessary SVG attributes
* lint + added loopLock to restore.ts
* added loopLock to newElement, updated test snapshots
* lint
* dislocate enpoint when breaking the loop.
* change icon & turn into a state style button
* POC: auto-transform to polygon on bg set
* keep polygon icon constant
* do not split points on de-polygonizing & highlight overlapping points
* rewrite color picker to support no (mixed) colors & fix focus handling
* refactor
* tweak point rendering inside line editor
* do not disable polygon when creating new points via alt
* auto-enable polygon when aligning start/end points
* TBD: remove bg color when disabling polygon
* TBD: only show polygon button for enabled polygons
* fix polygon behavior when adding/removing/moving points within line editor
* convert to polygon when creating line
* labels tweak
* add to command palette
* loopLock -> polygon
* restore `polygon` state on type conversions
* update snapshots
* naming
* break polygon on restore/finalize if invalid & prevent creation
* snapshots
* fix: merge issue and forgotten debug
* snaps
* do not merge points for 3-point lines
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* First iter
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* Restore binding
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* More actionFinalize
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* Additional fixes
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* New elbow arrow is removed if too small
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* Remove very small arrows
* Still allow loops
* Restore tests
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
* Update history snapshot
* More history snapshot updates
* keep invisible 2-point lines/freedraw elements
---------
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>
* change lock label
* feat: add unlock logic for single units on pointer up
* feat: add unlock popup
* fix: linting errors
* style: padding tweaks
* style: remove redundant line
* feat: lock multiple units together
* style: tweak color & position
* feat: add highlight for locked elements
* feat: select groups correctly after unlocking
* test: update snapshots
* fix: lasso from selecting locked elements
* fix: should prevent selecting unlocked elements and setting locked id at the same time
* fix: reset hit locked id immediately when appropriate
* feat: capture locked units in delta
* test: update locking test
* feat: show lock highlight when locking (including undo/redo)
* feat: make locked highlighting consistent
* feat: show correct cursor type when moving over locked elements
* fix history
* remove `lockedUnits.singleUnits`
* tweak button
* do not render UnlockPopup if not locked element selected
* tweak actions
* refactor: simplify type
* refactor: rename type
* refactor: simplify hit element setting & checking
* fix: prefer locked over link
* rename to `activeLockedId`
* refactor: getElementAtPosition takes an optional hitelments array
* fix: avoid setting active locked id after resizing
---------
Co-authored-by: dwelle <5153846+dwelle@users.noreply.github.com>