diff options
| author | Code WvS <code-wvs@quantentunnel.de> | 2015-03-28 09:43:59 +0100 |
|---|---|---|
| committer | Code WvS <code-wvs@quantentunnel.de> | 2015-03-28 09:43:59 +0100 |
| commit | 0f85420767b00ce706fd6646ff812b169962ac60 (patch) | |
| tree | 385ded45148464c0b6b64718f171958eeae91b86 /objects.js | |
| parent | 43e5b2eaf6897614a85f68f3b66e8db1a0af0282 (diff) | |
| download | snap-yow-0f85420767b00ce706fd6646ff812b169962ac60.tar.gz snap-yow-0f85420767b00ce706fd6646ff812b169962ac60.zip | |
extend clear block to remove only a sprite's own trails
Diffstat (limited to 'objects.js')
| -rw-r--r-- | objects.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -535,7 +535,7 @@ SpriteMorph.prototype.initBlocks = function () { clear: { type: 'command', category: 'pen', - spec: 'clear' + spec: 'clear %clearmode' }, down: { only: SpriteMorph, @@ -3106,8 +3106,15 @@ SpriteMorph.prototype.doStamp = function () { } }; -SpriteMorph.prototype.clear = function () { - this.parent.clearPenTrails(); +SpriteMorph.prototype.clear = function (mode) { + if (mode == 'my pen trails') { + window.penTrails.removeLayer(this.penShapes); + window.penTrails.removeLayer(this.penLines); + this.penShapes = L.layerGroup().addTo(window.penTrails); + this.penLines = L.layerGroup().addTo(window.penTrails); + } else { + this.parent.clearPenTrails(); + } }; // SpriteMorph pen size |
