Return a more suitable ref
Previously, the ref will always return an SVGGElement when the element's type is one of path
, circle
, line
, rect
, ellipse
, polygon
, polyline
. Because we wrap these types of elements in an SVGGElement and return the SVGGElement as the ref.
Now, I have changed it to return the first path element of the SVGGElement.
It's just a better, not a perfect way to handle the ref. Because roughjs
renders all shapes to SVGPathElement, we can't get the original ref.