summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-03-08 12:01:54 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-03-08 12:01:54 +0100
commit9ca58570819d895261734076af45b4c8c5d7b075 (patch)
tree1ae996146b9a89573bb6a66eb426ef80ffc3f390
parente9282585122bdd21ae4a8ebe2463eb75290baebf (diff)
downloadsnap-yow-9ca58570819d895261734076af45b4c8c5d7b075.tar.gz
snap-yow-9ca58570819d895261734076af45b4c8c5d7b075.zip
differ between shapes and lines
-rw-r--r--gui.js2
-rw-r--r--objects.js6
-rwxr-xr-xsnap.html2
-rw-r--r--store.js2
4 files changed, 10 insertions, 2 deletions
diff --git a/gui.js b/gui.js
index 8cd3aaa..ed01c23 100644
--- a/gui.js
+++ b/gui.js
@@ -2836,6 +2836,8 @@ IDE_Morph.prototype.newProject = function () {
window.map.removeLayer(window.penTrails);
}
window.penTrails = L.layerGroup().addTo(window.map);
+ window.penShapes = L.layerGroup().addTo(window.penTrails);
+ window.penLines = L.layerGroup().addTo(window.penTrails);
this.currentSprite = new SpriteMorph(this.globalVariables);
this.sprites = new List([this.currentSprite]);
diff --git a/objects.js b/objects.js
index 87ee8b7..a1b28bc 100644
--- a/objects.js
+++ b/objects.js
@@ -3342,7 +3342,7 @@ SpriteMorph.prototype.drawLine = function (start, dest) {
destLatLng,
],
{color: this.color.toString(), weight: this.size})
- .addTo(window.penTrails);
+ .addTo(window.penLines);
} else {
var latlngs = window.polylines[this.myPolylineIndex].getLatLngs();
for (var j = 0; j < latlngs.length; j++) {
@@ -3354,7 +3354,7 @@ SpriteMorph.prototype.drawLine = function (start, dest) {
.concat([destLatLng]);
L.polygon(polyLL,
{color: this.color.toString(), weight: this.size})
- .addTo(window.penTrails);
+ .addTo(window.penShapes);
break;
}
}
@@ -4722,6 +4722,8 @@ StageMorph.prototype.drawOn = function (aCanvas, aRect) {
StageMorph.prototype.clearPenTrails = function () {
window.map.removeLayer(window.penTrails);
window.penTrails = L.layerGroup().addTo(window.map);
+ window.penShapes = L.layerGroup().addTo(window.penTrails);
+ window.penLines = L.layerGroup().addTo(window.penTrails);
this.trailsCanvas = newCanvas(this.dimensions);
this.changed();
};
diff --git a/snap.html b/snap.html
index 597ac17..4542c92 100755
--- a/snap.html
+++ b/snap.html
@@ -121,6 +121,8 @@
// so polylines contains complete lines created by different sprites.
// These lines might be (partially) transformed into polygons.
window.penTrails = L.layerGroup().addTo(map);
+ window.shapes = L.layerGroup().addTo(window.penTrails);
+ window.lines = L.layerGroup().addTo(window.penTrails);
window.polylines = polylines;
polylineIndex = 0;
polylines = [];
diff --git a/store.js b/store.js
index ad7cf82..9e7c1f8 100644
--- a/store.js
+++ b/store.js
@@ -1346,6 +1346,8 @@ SnapSerializer.prototype.openProject = function (project, ide) {
// TODO: "pen trails" are not saved
window.map.removeLayer(window.penTrails);
window.penTrails = L.layerGroup().addTo(window.map);
+ window.penShapes = L.layerGroup().addTo(window.penTrails);
+ window.penLines = L.layerGroup().addTo(window.penTrails);
sprites.forEach(function (sprite) {
// create the markers