Releases: meerk40t/svgelements
Bug Fixes
- Coord values without points raise ValueErrors. Path("sn") will throw an error rather than create a faulty object.
- Various dunder methods will return NotImplemented explicitly.
- Adding a Path with something that cannot add be added to it, will register a TypeError rather than recurse an infinite loop.
- Reify performed on a shape with a stroke width will be scaled up by a factor of the
sqrt(abs(det))
of the matrix. - Validate Subpaths will not be applied to position
-1
as could happen in Path.extend() on an empty path. - scale values for round shapes during reification is done as the absolute value. This is to correct the inverted sweep issue.
- Roundshapes have an added
_ramanujan_length
value. - Subpaths now accept slices as part of getitem.
- svg_structure_parse now parses event start-ns and saves the namespaces used in the values dict.
- Default colors for fill are "black" and stroke is "none" rather than automatically setting them to the
currentcolor
, these values match the svg spec.
Relative and Smooth Preservation.
Preserves Relative and Smooth values as initially set in the path. These can be overridden by setting relative=True
, relative=False
, smooth=True
, smooth=False
.
Rebuilt the core SVG path parser. This was required to pass W3C Path17 and Path20 tests. The code now correctly parses svg arc flags as either 0 or 1 rather than a float. And will stop parsing paths if unknown characters are found within the data.
Correct SVGText Bounds, Issue #45
Corrects an issue with rotated SVGText bounds. And an issue where the bias in validation could produce wrong results for .reverse() call.
Corrections for Path Bounding Boxes
Corrects the PathSegment bounding boxes for Arc, QuadraticBezierCurve, and CubicBezierCurve.
Near Collinear Quad Corrections
Lengths for almost collinear quads could be outside the error range but still so close as to divide by zero or hit a domain value error.
.length()/.point() of lengthless paths
.length() / .point() for lengthless paths no longer crashes.
Use/Def
This version mostly corrects use/defs tags. These now are parsed inline with the data set.
Arcs have changed arc
and sweep
to arc_flag
and sweep_flag
to make them distinct from sweep.
Arcs allow definition based on a control point or a bulge.
Fixed several minor bugs.
Correct Inverse Matrix
Corrects inverse matrix
Adds invert dunder '~'.
Adds coverage for inverse matrix.
Initial Transform, Tweaks.
Few required softened edges
Bounding Box
Improvements to .bbox() so that they are standardized for most SVGElements.