svgdotjs / svg.draw.js

An extension of svg.js which allows to draw elements with mouse
MIT License
236 stars 57 forks source link

Cleaning a polygon #37

Open G89Angel opened 6 years ago

G89Angel commented 6 years ago

Hello, I've a tool selection for my SVG, with polygon and rectangle drawings.

If I click the polygon tool (which launches a svg.polygon.draw()) and immediately after that I click the rectangle tool (svg.rect.draw()) without actually using the polygon, rect will place two small circles on starting and ending corners of the rectangle.

Is there any workaround to avoid this behaviour? I tried this without succeeding: polygon.draw('cancel')

as set doesn't exist at the moment of calling it

// Remove all circles
    this.set.each(function () {
        this.remove();
    });

I can't tell if this is an issue with the clean function or I'm doing something wrong.

G89Angel commented 6 years ago

Noticed this problem has been fixed already in github but the updated version is not yet on npm. @Fuzzyma are you planning to update npm soon with recent changes?