Fixed issue with multipaths

This commit is contained in:
Devine Lu Linvega 2017-01-26 11:28:41 -07:00
parent 041d7ecfdf
commit 5575e9f103
4 changed files with 10 additions and 13 deletions

View File

@ -92,12 +92,5 @@ function Keyboard()
Object.keys(ronin.modules).forEach(function (key){
ronin.modules[key].key_escape();
});
// Clear managed layers
Object.keys(ronin.surface.layers).forEach(function (key) {
if(ronin.surface.layers[key].manager){
ronin.surface.layers[key].clear();
}
});
}
}

View File

@ -24,15 +24,18 @@ function Cursor(rune)
this.active = function(cmd)
{
console.log("!");
if(cmd.bang()){
console.log("??");
this.magnetism = null;
if(this.layer){ this.layer.remove(this); }
return;
}
if(!this.layer){ this.create_layer(); }
this.layer.clear();
if(cmd.bang()){
this.magnetism = null;
this.layer.remove(this);
}
if(cmd.position()){
this.grid = cmd.position();
}

View File

@ -27,6 +27,7 @@ function Layer(name,manager = null)
this.remove = function(manager)
{
console.log("Removing layer "+this.name);
manager.layer = null;
ronin.surface.layers[this.name].element.outerHTML = "";
delete ronin.surface.layers[this.name];

View File

@ -27,7 +27,7 @@ function Vector(rune)
this.paths.push(this.create_path());
this.coordinates = [];
this.layer.remove(this);
if(this.layer){ this.layer.remove(this); }
ronin.surface.active_layer.context().lineCap = cmd.variable("line_cap") ? cmd.variable("line_cap").value : "square";
ronin.surface.active_layer.context().lineWidth = cmd.variable("stroke_width") ? cmd.variable("stroke_width").value : 10;