Create sketchy, hand-drawn-like images from SVGs
Added an optional parameter to sketch()
that allows re-evaluation of the currently set source SVG container when executing sketch()
. This enables the same Svg2Rough.js instance to be run multiple times on a single input container with changing SVG content.
Updated readme and new a hero image
Fixed randomly missing hachure fill when using randomized fills.
Updated dependencies.
SVGPatternElements
which are optionally sketched as well. Can be disabled with the new property sketchPatterns: bool
.3
by default to decrease SVG output file size. Can be overwritten by setting a specific fixedDecimalPlaceDigits
in the roughConfig
.units-css
dependency.auto
or auto-start-reverse
.stroke-width
).SVGPathElement
are now applied.SVGGElement
s are now considered.RenderMode
to OutputType
to better account for its actual effect.redraw()
to sketch()
which is now async.sketch()
must be called explicitly now.Fixed an infinite loop that was triggered by specific style configurations.
foreignObject
elements from the source SVG to the sketched SVG. These elements have been discarded previously but foreignObject
s are sometimes used for text labels in SVGs (e.g. mermaid diagrams), so now they should at least appear in the SVG output. Note: This is currently only supported for SVG rendering.viewBox
differs from the viewport of the SVG. For preserveAspectRatio
only none
and the default (i.e. xMidYMid
) behavior is supported.Updated Rough.js dependency to make use of its recent bugfixes.