Svg2roughjs Versions Save

Create sketchy, hand-drawn-like images from SVGs

v3.2.0

5 months ago

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.

v3.1.5

5 months ago

Updated readme and new a hero image

v3.1.4

5 months ago

Fixed randomly missing hachure fill when using randomized fills.

v3.1.3

6 months ago

Updated dependencies.

v3.1.0

10 months ago

v3.1.0

New Features

  • Optional seed property to control the randomness of the sketch. Specifying this property implicitly sets the seed property for Rough.js to the same value. This may be overwritten by providing a different seed with the roughConfig object.

Housekeeping

  • Updated dependencies.

v3.0.0

2 years ago

v3.0.0

New Features

  • Support for SVGPatternElements which are optionally sketched as well. Can be disabled with the new property sketchPatterns: bool.
  • Hachure fill styles are adjusted based on the shape's size and aspect-ratio to create a more vivid sketch.

Improvements

  • Floating point precision to is set to 3 by default to decrease SVG output file size. Can be overwritten by setting a specific fixedDecimalPlaceDigits in the roughConfig.
  • Removed units-css dependency.
  • HTML canvas output is now created with the SVG rendering and drawn onto canvas eventually. This supports more features than the previous direct canvas rendering.

Fixes

  • Fixed orientation of markers with auto or auto-start-reverse.
  • Fixed rendering of percentage values on presentation attributes (e.g. stroke-width).
  • Clips with SVGPathElement are now applied.
  • Clips on SVGGElements are now considered.
  • IE11: Fixed traversing of element tree when determing inherited presentation attributes.
  • IE11: Fixed missing data-uri images in sketched output.

Incompatible changes

  • Renamed RenderMode to OutputType to better account for its actual effect.
  • Renamed redraw() to sketch() which is now async.
  • Property changes do not automatically trigger repaints. So after changes, sketch() must be called explicitly now.

v2.3.2

2 years ago

Fixed an infinite loop that was triggered by specific style configurations.

v2.3.1

2 years ago
  • Fixed marker and foreignObject translation
  • Consider marker scaling in user-space
  • Improved handling of percentage width/height on input SVG,
  • Improved text rendering with tspan styling
  • Improved canvas text rendering for certain cases

v2.3.0

2 years ago
  • Copy foreignObject elements from the source SVG to the sketched SVG. These elements have been discarded previously but foreignObjects 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.
  • Fixed default scaling behavior if viewBox differs from the viewport of the SVG. For preserveAspectRatio only none and the default (i.e. xMidYMid) behavior is supported.

v2.2.2

2 years ago

Updated Rough.js dependency to make use of its recent bugfixes.