diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-03-22 18:29:44 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-22 18:29:44 +0100 |
| commit | e13a19b378eed8924a596878f21169be68cea251 (patch) | |
| tree | 07ed20042d330eddb220b9f675d3730d4bb5ef3f | |
| parent | da0a10f4e989d83a0768602514281f0e40666e7d (diff) | |
| download | snap-yow-e13a19b378eed8924a596878f21169be68cea251.tar.gz snap-yow-e13a19b378eed8924a596878f21169be68cea251.zip | |
on pen up, do not draw multiple polygons from the same line
| -rw-r--r-- | objects.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -2937,10 +2937,13 @@ SpriteMorph.prototype.up = function (mode) { // overrides PenMorph.up this.isDown = false; this.penMode = mode[0]; // default to line + if (window.polylines[this.myPolylineIndex].getLatLngs().length < 3) + return; + if (this.penMode == 'a shape') { // transform the line that has just been finished into a polygon window.polygons[window.polygonIndex++] = L.polygon( - window.polylines[this.myPolylineIndex].getLatLngs(), + window.polylines[this.myPolylineIndex++].getLatLngs(), {color: this.color.toString(), weight: this.size}) .addTo(window.penShapes); // remove the line that is now a filled shape |
