1
0
Fork 0
Commit graph

24 commits

Author SHA1 Message Date
joostdecock
a2800dddda feat(core): Added Pattern.getLogs() and updated Pattern.getRenderProps()
The data returned by `Pattern.getRenderProps()` was not serializable as
we were returning `this` all over the place, thereby including marcors,
log methods, cyclic object references, and so on.

This commit changes that by implementing a `.asRenderProp()` method on
all of the various objects (stack, part, path, point, snippet,
attributes, svg) and only including data that can be serialized.

In addition, we no longer include the logs in the renderProps because
they are not related to rendering the pattern.
Instead, the new method `Pattern.getLogs()` gives you the logs.
2023-06-01 16:45:13 +02:00
joostdecock
92e8c6fdca chore(core): Code QA fixes 2023-05-19 10:34:51 +02:00
joostdecock
b33a739f54 Merge branch 'develop' into annotations 2023-04-15 15:47:00 +02:00
joostdecock
3cbb59e30f chore(core): Linter fix 2023-04-15 15:37:48 +02:00
joostdecock
cc41573b6f chore(core): Linter fix 2023-04-15 15:34:39 +02:00
joostdecock
182c4f4d64 chore: Linter warnings 2023-04-15 15:31:25 +02:00
joostdecock
5ba6e12469 fix(core): Make Path.clean() check for valid paths before returning
A path that has no drawing operations or only a move operation causes
problems with the path offset code.

This will cause Path.clean() to return false in such a case, which in
turn will cause Path.__asPath() to return false when called from the
offset code.

We check this return value in the offset code and do not push this
segment to the offsetted path.

This fixes #3038
This closes #3056
2023-04-10 11:27:07 +02:00
Benjamin F
65895713c4 fix(core): Fix Path.join() to work with noop 2022-12-23 15:34:18 -08:00
Benjamin F
491902aca6 fix(core): In Path.clean(), initialize cur variable before use. 2022-12-04 20:19:51 -08:00
joostdecock
fab1e2f877 feat(core): Added Path.clean() method. Closes #3038 and #3056
This is a fix for bug #3038 which was investigated by @BenJamesBen
who also proposed a fix in PR #3056

However, after discussing the matter, we agreed it would be better
to have a generic method in core to guard against the issue of
spurious drawing operations.

This commit adds the `Path.clean()` method that does exactly that,
as well as its documentation.
2022-12-03 17:28:05 +01:00
Joost De Cock
f759f3986a feat(core): Cast distance to number. See #2897 2022-10-07 21:41:45 +02:00
Joost De Cock
693243d8e9 feat(core): Cast distance to number in Path.offset() 2022-10-06 23:12:26 +02:00
Joost De Cock
3cb5384df5 feat(core): Added path.addText and path.setText methods
Also added a parameter to path.reverse to make it a deep clone.
2022-09-27 18:22:56 +02:00
Joost De Cock
d5eb2946d3 chore(core): More unit tests 2022-09-19 18:04:47 +02:00
Joost De Cock
d7cbd42ced feat(core): Added path.smurve() and path.smurve_() methods 2022-09-19 09:28:45 +02:00
Joost De Cock
21ea22a18d chore(core): Don't use reveal, use unhide 2022-09-18 23:01:10 +02:00
Joost De Cock
5dc7401308 chore(core): Use hide, not render 2022-09-18 18:16:17 +02:00
Joost De Cock
200cebf582 chore(core): Refactor v3 code 2022-09-18 15:11:10 +02:00
Joost De Cock
56427cc4bd chore(core): Linter fixes 2022-09-15 06:34:05 +02:00
joostdecock
48b366c57e fix(core): Issue with hiding dependencies 2022-09-11 18:00:41 +02:00
joostdecock
4121ef44d2 wip(core): Work on path unit tests 2022-09-10 18:23:19 +02:00
Joost De Cock
0cbffd6dc6 wip(core): Work on late-stage config resolver
This moves resolving of the config from the pattern constructor to the
init() method. The idea is that adding a part to a pattern is exactly
the same as adding a part to a design. In other words, late-stage adding
of parts would be no different as the config gets resolved after that.

This is currently broken in many different ways, but the unit tests
particular to this new way of resolving the config do pass.
2022-09-09 20:20:38 +02:00
Joost De Cock
c09ae4aa69 wip(core): Migrated to named exports only 2022-08-28 02:14:39 +02:00
Joost De Cock
3671f44e90 chore: Move core files to .mjs 2022-08-26 18:51:02 +02:00
Renamed from packages/core/src/path.js (Browse further)