diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-03-21 16:56:48 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-21 16:56:48 +0100 |
| commit | 3d03f9eb5cfe018fa570c95b2a58b3938665c5c6 (patch) | |
| tree | 0d41328ba385806d878a4e4e8460f4412393a397 /objects.js | |
| parent | 312ec24097d8a2e6adfdd55e24b3472e9d514be5 (diff) | |
| download | snap-yow-3d03f9eb5cfe018fa570c95b2a58b3938665c5c6.tar.gz snap-yow-3d03f9eb5cfe018fa570c95b2a58b3938665c5c6.zip | |
splice, not slice lines to polygons
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3388,8 +3388,13 @@ SpriteMorph.prototype.drawLine = function (start, dest) { // TODO: detect and join lines with "same points" if (latlngs[j].distanceTo(destLatLng) <= 1) { var polyLL = latlngs - .slice(j, latlngs.length) + .splice(j, latlngs.length) .concat([destLatLng]); + // remove last part of line and replace by polygon + // splice deleted the latlngs that appear now in the polygon + window.polylines[this.myPolylineIndex] = L.polyline(latlngs, + {color: this.color.toString(), weight: this.size}) + .addTo(window.penLines); L.polygon(polyLL, {color: this.color.toString(), weight: this.size}) .addTo(window.penShapes); |
