64 Commits

Author SHA1 Message Date
Alonso Torres
217284b1e1
Improve path operations and edition (#10807)
*  Improve path operations and edition

* 🐛 Fix floating-point equality issues in path editing

Replace exact equality checks with tolerance-based comparisons
in path editing functions to handle floating-point rounding
differences after transforms, rotations, or curve fitting.

Changes:
- distribute-content: Round coordinates to 0.1 precision before
  grouping to ensure coincident nodes move together
- separate-node: Use gpt/close? instead of exact equality to
  find nodes with floating-point imprecision
- collision-step: Use mth/close? for tolerance-based comparison
  to detect paste collisions correctly
- resolve-edit-fills: Add cycle detection to prevent infinite
  loops with corrupted parent chains

Made collision-step, available-offset-step, and resolve-edit-fills
public for better testability.

Added comprehensive tests for all fixes covering both exact and
floating-point coordinate scenarios.

AI-assisted-by: qwen3.7-plus

* 🐛 Fix path editor code review findings

Fix issues identified during code review of path editor enhancements:

- Fix unused binding lint warning in distribute-content that blocked CI
- Fix collision-step floor comparison to use round instead of floor,
  correctly detecting collisions when coordinates drift slightly below
  integer boundaries
- Fix resolve-edit-fills to recurse through empty parent groups when
  searching for inherited fills in nested group hierarchies
- Fix expand-coincident-node-indices to use fuzzy comparison (gpt/close?)
  instead of exact equality, handling floating-point divergence after
  transforms or rotations
- Remove unreachable dead code in path-point* on-pointer-down handler
- Add tests for collision-step boundary cases, nested group fill
  inheritance, and coincident node alignment/flipping

AI-assisted-by: mimo-v2.5-pro

---------

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-08-27 10:51:10 +02:00
Andrey Antukh
81c3b3cd56
📎 Update copyright name on file header (#11346) 2026-08-25 11:55:10 +02:00
Yamila Moreno
ddba2ffa75
📎 Update Kaleidos Copyright (#9929) 2026-05-29 11:24:58 +02:00
Andrey Antukh
f8c04949e1
🐛 Fix nil path content crash by exposing safe public API (#8806)
* 🐛 Fix nil path content crash by exposing safe public API

Move nil-safety for path segment helpers to the public API layer
(app.common.types.path) rather than the low-level segment namespace.
Add nil-safe wrappers for get-handlers, opposite-index, get-handler-point,
get-handler, handler->node, point-indices, handler-indices, next-node,
append-segment, points->content, closest-point, make-corner-point,
make-curve-point, split-segments, remove-nodes, merge-nodes, join-nodes,
and separate-nodes. Update all frontend callers to use path/ instead of
path.segment/ for these functions, removing the path.segment require
from helpers, drawing, edition, tools, curve, editor and debug.

Replace ad-hoc nil checks with impl/path-data coercion in all public
wrapper functions in app.common.types.path. The path-data helper
already handles nil by returning an empty PathData instance, which
provides uniform nil-safety across all content-accepting functions.

Update the path-get-points-nil-safe test to expect empty collection
instead of nil, matching the new coercion behavior.

* ♻️ Clean up path segment dead code and add missing tests

Remove dead code from segment.cljc: opposite-handler (duplicate of
calculate-opposite-handler) and path-closest-point-accuracy (unused
constant). Make update-handler and calculate-extremities private as
they are only used internally within segment.cljc.

Add missing tests for path/handler-indices, path/closest-point,
path/make-curve-point and path/merge-nodes. Update extremities tests
to use the local reference implementation instead of the now-private
calculate-extremities. Remove tests for deleted/privatized functions.

Add empty-content guard in path/closest-point wrapper to prevent
ArityException when reducing over zero segments.
2026-04-07 18:54:14 +02:00
Andrey Antukh
7ab5f241da 🐛 Fix TypeError when path content is nil in get-points calls
Use nil-safe path/get-points wrapper (some-> based) instead of
direct path.segment/get-points calls in edition.cljs to prevent
'Cannot read properties of undefined (reading get)' crash.

Add nil-safety test to verify path/get-points returns nil without
throwing when content is nil.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
2026-03-10 12:21:13 +00:00
Andrey Antukh
6f0685ba8e
🐛 Fix several issues related to path edition (#8187)
*  Improve save-path-content event consistency

Mainly removing possible race conditions from the event
implementation.

*  Ensure path content snapshot on start-path-edit event

*  Reuse already available shape-id on split-segments
2026-01-26 22:48:57 +01:00
alonso.torres
d470d96833 🐛 Fix problem with dragging handlers 2026-01-07 11:00:02 +01:00
Andrey Antukh
f1a557c372 Add minor performance enhacements to viewport top-bar 2025-05-06 13:39:17 +02:00
Andrey Antukh
61c23877c1 Rename handler->point to get-handler-point 2025-05-06 13:39:14 +02:00
Andrey Antukh
1d0020f6e6 Replace duplicate fn get-point with segment->point 2025-05-06 13:39:13 +02:00
Andrey Antukh
b0cbe3cec8 Replace content->points with faster get-points 2025-05-06 13:39:11 +02:00
Andrey Antukh
1fc0203c38 🎉 Add full integration with path data type feature 2025-05-06 13:39:10 +02:00
Andrey Antukh
85746e7cb2 ♻️ Refactor state locality
The main purpose of this refactor is reduce
a custom state from different pages and unify
them under common access patterns
2025-01-16 15:31:18 +01:00
Eero Pitkänen
0c8678eb87 🐛 Fix dragging path points by returning closest point instead of only the distance 2024-10-10 11:15:49 +02:00
Andrey Antukh
6436ef334b ♻️ Refactor persistence layer 2024-06-04 10:15:32 +02:00
Alejandro Alonso
b5c419512f Add locking degrees increment (hold shift) on path edition 2024-06-03 13:01:45 +02:00
alonso.torres
895f649ef1 🐛 Stop drag events when the user focus out the application 2024-03-15 15:34:16 +01:00
Alejandro Alonso
bad0fb912b :tada Add undo-group for layout updates 2024-03-08 11:31:32 +01:00
Aitor
c123cf6e98 🐛 Fix path drawing inconsistencies 2024-02-29 10:20:47 +01:00
Aitor
e6fcb418b1 🐛 Fix toolbar hidden after unfinished path 2024-01-22 18:26:10 +01:00
Andrey Antukh
96f5a33f5f ⬆️ Upgrade to beicon2 (part1) 2023-12-26 14:14:20 +01:00
Andrey Antukh
82dc1526d4 Add performance oriented refactor for mouse streams 2023-11-29 09:15:53 +01:00
Andrey Antukh
52fbc678f3 ♻️ Move app.common.pages to app.common.files 2023-11-16 11:07:36 +01:00
Andrey Antukh
3ceb4cf895 ♻️ Make svg to shapes conversion code multiplatform
- Move clojure code to common
- Rewrite some native-js code into optimized clojure
2023-11-07 12:48:31 +01:00
Eva
d913637290 🐛 Fix several frontend errors related with new UI 2023-10-04 13:11:58 +02:00
alonso.torres
dd472bee64 🐛 Fix problem when transforming shape to path 2023-06-14 18:07:33 +02:00
alonso.torres
468e61e1e0 🐛 Fix snap pixel when moving path points on high zoom 2023-03-13 10:30:12 +01:00
alonso.torres
75d6e21af8 Show tools on path creation. Change snap while drawing 2023-01-19 13:39:21 +01:00
Eva
f93d0e1c4d 🐛 Fix snap to pixel on path creation and edit 2023-01-19 11:31:46 +01:00
alonso.torres
2da421bb7a 🐛 Fix error on path editing 2023-01-12 12:35:20 +01:00
alonso.torres
6c2d2e142b Improve reflow texts 2022-12-07 15:05:38 +01:00
alonso.torres
441e142349 🐛 Fix reflow layout when changes in paths and texts 2022-11-22 17:08:23 +01:00
Alejandro Alonso
c670d81a20 🐛 Fix assertion error trying to move board if path tool selected 2022-10-17 12:00:39 +02:00
Andrey Antukh
41134f22e9 📎 Update license header 2022-09-20 23:23:22 +02:00
alonso.torres
b38ffdcf30 ♻️ Refactor workspace common 2022-06-30 13:09:35 +02:00
Alejandro Alonso
08c6e9b702 🐛 Fix different behaviour during image drag 2022-04-21 12:13:12 +02:00
Andrés Moya
e609670a41 🔧 Use changes-builder in many places 2022-03-10 15:37:10 +01:00
Josh Soref
589e646023 🐛 Fix typos in frontend 2021-11-15 09:51:34 -05:00
alonso.torres
6fd35ae5d9 Updates selrects, groups to path 2021-09-27 21:58:29 +02:00
Andrey Antukh
7e0c097f23 🎉 Add linter for check duplicte potok types. 2021-09-07 11:48:14 +02:00
alonso.torres
4e439792ec Double click won't make a shape a path until you change a node 2021-07-08 16:02:39 +02:00
alonso.torres
234a698538 ❇️ Fix linter warnings 2021-06-22 11:11:49 +02:00
Andrey Antukh
3e4e54870b Fix linter issues on frontend (part 2). 2021-06-18 11:20:25 +02:00
alonso.torres
f8f506a8be 🐛 Fix some problems with paths 2021-05-27 11:10:30 +02:00
Andrey Antukh
0f8e2a9b1b 🎉 Add experimental trazability to update-file. 2021-05-10 14:53:47 +02:00
alonso.torres
5e0101e424 🐛 Fixes problem with edition state and paths 2021-05-07 13:13:58 +02:00
alonso.torres
5352918ff8 🐛 Fix problem when deleting all nodes from a path 2021-05-06 15:55:02 +02:00
alonso.torres
59187f9ff4 ♻️ Refactor commit-changes and undo actions 2021-04-27 18:00:59 +02:00
alonso.torres
14475fdc67 Add move path points with keyboard 2021-04-26 18:30:56 +02:00
alonso.torres
1a7b098282 Improvements to loop removing 2021-04-23 13:29:54 +02:00