Fixed issue with close

This commit is contained in:
Devine Lu Linvega
2018-02-06 19:51:09 +13:00
parent d119160773
commit 36f5644c45
6 changed files with 7 additions and 18 deletions

View File

@@ -55,10 +55,11 @@ function Tool()
this.can_cast = function(type)
{
if(!type){ return false; }
// Cannot cast close twice
if(type == "close"){
var prev = this.layer()[this.layer().length-1];
if(prev.type == "close"){
if(!prev || prev.type == "close"){
return false;
}
}
@@ -165,5 +166,8 @@ function Tool()
this.import = function(layers)
{
this.layers = layers;
dotgrid.history.push(this.layers);
this.clear();
dotgrid.draw();
}
}