Releases: meerk40t/svgelements
Add in bounds with strokes: .bbox(with_stroke=True)
This version permits the calculation of bounding boxes with the given stroke-width values, for transformed and non-transformed shapes.
-
The goal of this is to provide a bounding box sufficient to capture not only the shape but the full displayed shape.
-
This version also includes some other minor changes to
__repr__
for the various objects.
Numerical Stability of Arc Bulge near Slope Zero
If the slope is like 1e-15 close to zero it can cause the calculated center to move a bit.
Image and Text. Repr Corrections
SVGImage and SVGText were renamed with strong backwards compatible assignments to Image and Text.
The potential for that to break compatibility is the reason for the this goes to 1.6.0 rather than 1.5.7. No testing found any breaks. If you import *
the existence of svgelements.Image
could mess with PIL namespaces. If you import correctly this should not be an issue.
The rest of this version is __repr__
corrections for the minor objects and coverage for those.
Minor Corrections
Correct repr()
values
Added a few __eq__()
functions.
Correct degenerate width-less Rect.
Bug Fixes and Maintenance
- Fallback if scipy failed for any reason (it's not a requirement, but having it makes some math easier).
- Interpolate Arcs As Cubics and Quads failed for degenerate Arcs.
- Fixed
rect
of unknown size with unknown rounded corners would valueError on the length math without the conversions being known. - Shapes have
._strict
value set to True. Could permit some non-spec behaviors in the future. - Rect allows for non-strict inverted rounded rectangle corners to imply scooped corners.
- Corrected Issue #114.
Several bug fixes. Color.distinct()
- Correct Attributes-id bug in parsing end (could cause crashes during parsing)
- Add
attributes
to .values, was otherwise unable to see what values that node originally had without cascading if a looking for a custom value. - Add Color.distinct() Allows simple color distinction algorithm.
- Fixed kwargs 'alpha' bug. Weirdly, set the blue value.
Correct Small Bugs in Copy of Group and SVGText
A copy of SVGText object or a copy of a Group object didn't call the SVGElement defines to set the value of .values and .id instead leaving these with None value.
Smoothing the Rough Edges of 1.5.0
- Color can now accept keyword args with colors eg
Color('red', alpha=180)
- Default use of Color(int) is rgb. Eg.
Color(0xFF0000, 0.5)
is half opaque red. - Keyword args for Color accepts argb and rgba. Eg.
Color(argb=0xFF00FF)
- Keyword args added for
hue
,saturation
,lightness
andalpha
. - Color has
.argb
,.rgb
and.rgba
properties. These can be set:color.argb = 0xFF0000FF
Color.hsl_to_int
does not require creating a Color object. hsl init, calls the function..hue
had a bug which gave the hue in turns. It should have given hue in degrees.
Correct Issue #109: RGBA
@Lofgren correctly noted the CSS color definitions are RGBA and not ARGB. Especially regarding the parsing of 4 and 8 digit hex values this was parsed contrary to spec.
Major version bump, because this is a slightly breaking change as int(color) will now produce RGBA. If you convert colors with the .red
.blue
.green
and .alpha
the code will work the same. However if you converted to int(color) using or using .value
within the color, the internal data value is now RGBA.
Some legacy code was eliminated.
Correct Issue #107
The ability to perform t = Group() * Matrix()
resulted in a crash due to it not initializing the copy() of the Group's .transform
value.