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 SVG.Point has the clone()method which is very useful when you want to store a point from an event for later use. Currently you will get a reference to the SVGPoint which changes with mousemove.
While creating an answer for https://stackoverflow.com/questions/59585107/how-do-i-draw-an-svg-polyline-with-45-degree/59652093#59652093, I found that all events emit a SVGPoint as
p
and not a SVG.Point.The SVG.Point has the
clone()
method which is very useful when you want to store a point from an event for later use. Currently you will get a reference to the SVGPoint which changes withmousemove
.As an example:
In the above snippet
point
will always update as the mouse moves because it is a reference.The work-around is to get the primitive values and store them instead. As shown here:
But it would be much nicer if one could just use the
clone()
method. As in this example:The text was updated successfully, but these errors were encountered: