Fixed issue with import

This commit is contained in:
Devine Lu Linvega
2018-02-08 09:34:17 +13:00
parent 7858abeca6
commit efd80ae869
2 changed files with 12 additions and 2 deletions

View File

@@ -175,6 +175,16 @@ function Tool()
return JSON.stringify(copy(target), null, 2);
}
this.replace = function(layers)
{
if(layers.length != 3){ console.log("Incompatible"); return; }
this.layers = layers;
this.clear();
dotgrid.draw();
dotgrid.history.push(this.layers);
}
this.import = function(layer)
{
this.layers[this.index] = this.layers[this.index].concat(layer)