From 407bc28cc73916ed13870d99059e0913893d8937 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 26 Jan 2017 11:35:58 -0700 Subject: [PATCH] Clear vector with escape --- scripts/core/commander.js | 1 + scripts/modules/vector.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/core/commander.js b/scripts/core/commander.js index 941d292..6849eb9 100644 --- a/scripts/core/commander.js +++ b/scripts/core/commander.js @@ -15,6 +15,7 @@ function Commander(element,element_input) queue = input_str.split(";"); } else{ + queue = []; queue.push(input_str) } run(); diff --git a/scripts/modules/vector.js b/scripts/modules/vector.js index 5caa8c6..6dba87b 100644 --- a/scripts/modules/vector.js +++ b/scripts/modules/vector.js @@ -109,7 +109,6 @@ function Vector(rune) this.coordinates.push("M"+position.render()); } else{ - var offset = this.last_pos ? position.offset(this.last_pos) : position; if(keyboard.shift_held == true && keyboard.alt_held == true){ @@ -131,4 +130,11 @@ function Vector(rune) this.passive(commander.cmd()); this.last_pos = position; } + + this.key_escape = function() + { + if(this.layer){ this.layer.remove(this); } + this.coordinates = []; + this.last_pos = null; + } } \ No newline at end of file