You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The endpoints of the Line element cannot be animated because drawsvg.Line generates an SVG <path> tag instead of a <line> tag. This could be solved by changing drawsvg.Line to use the <line> tag but this may have unintended effects on existing code using the Line element.
Workaround
Use this definition of Line in place of drawsvg.Line.
classLine(draw.DrawingBasicElement):
'''A line element that uses the SVG <line> tag. The endpoints of this custom Line element can be animated. This is a workaround because `drawsvg.Line` cannot be animated.'''TAG_NAME='line'def__init__(self, x1, y1, x2, y2, **kwargs):
super().__init__(x1=x1, y1=y1, x2=x2, y2=y2, **kwargs)
Discussed in #121
Originally posted by PieterMostert March 2, 2024
I've tried modify the example in the README to animate the endpoints of a line, but nothing happens:
Am I doing something wrong, or is this a bug? Either way, I'd appreciate advice on how to get this to work.
The text was updated successfully, but these errors were encountered: