This bug would be triggered by an edge-case where we have a path
that is made up of multiple curves/lines.
If the distance to shift lies just beyond the end of one segment,
yet the remaining distance is smaller than the step (by default
that means smaller than 1/25mm) no point would be returned.
This closes#1140
The Draft react component would load the snippets that are part of our
plugin bundle. However, any additional snippets that are created by
plugins would not not get added to the `defs` section, and thus not
be rendered.
This changes the behavior by doing two things:
- in `core` it adds an SVG object to the renderProps, and makes
sure to run the `preRender` hook on this SVG object prior to
returning the renderProps. This way, svg.defs now holds all
defs, including any that may have been added by custom plugins
- in the `Draft` component, we no longer add a list of predefined
snippets to the defs section, but instead just use the svg.defs
section verbatim. This removes any discrepancies in how SVG
rendering and React rendering handles the defs section of the
SVG document, and thus displays snippets.
Since the bezier-js library is bundled with @freesewing/core, we
now expose it via utils. This way, people who want to use this
in their plugins or other code are not forced to import it again.
Plugins can pass a configuration object (or any
sort of data) when loaded with `pattern.use()`.
We use to set that parameter to `false` when loading, but
now we leave it `undefined`. This makes is easy for plugins
to use a default parameter for the configuration/data passed
to it.
Penelope and Waralee are two new patterns by @woutervdub
This integrates them in our monorepo, including the translations
in the i18n package and the package info in the pattern-info pattern
This commit also includes a minor tweak to our core package.
Previously, you had to instantiate a pattern to get its config,
but that is no longer the case. The default export (the constructor)
now has a config property you can access without instantiating the pattern.
All of these changes will trigger a new minor release when we merge them
into master. Specifically v2.1