diff --git a/scripts/modules/typographe.js b/scripts/modules/typographe.js index 283246c..01340f7 100644 --- a/scripts/modules/typographe.js +++ b/scripts/modules/typographe.js @@ -52,7 +52,7 @@ function Typographe(rune) this.widget_cursor = function() { - return "&"; + return "Typographe"; } this.mouse_down = function(position) diff --git a/scripts/modules/vector.js b/scripts/modules/vector.js index 74edcfd..2a3afe6 100644 --- a/scripts/modules/vector.js +++ b/scripts/modules/vector.js @@ -10,7 +10,7 @@ function Vector(rune) this.install = function() { this.layer = new Layer("Vector.Preview",this); - this.layer.element.setAttribute("style","z-index:8000"); + this.layer.element.setAttribute("style","z-index:8000;opacity:0.75"); ronin.surface.add_layer(this.layer); } @@ -33,4 +33,38 @@ function Vector(rune) ronin.surface.active_layer.context().strokeStyle = cmd.variable("stroke_color") ? cmd.variable("stroke_color").value : "#ffffff"; ronin.surface.active_layer.context().stroke(new Path2D(cmd.content.join(" "))); } + + // Mouse + + this.click = null; + + this.widget_cursor = function() + { + return "Vector"; + } + + this.memory = null; + + this.mouse_down = function(position) + { + this.click = true; + this.memory = commander.element_input.value; + + commander.element_input.value += "L"+position.render()+" "; + commander.hint.update(); + this.passive(commander.cmd()); + } + + this.mouse_move = function(position) + { + if(!this.click){ return; } + commander.element_input.value = this.memory+"L"+position.render()+" "; + commander.hint.update(); + this.passive(commander.cmd()); + } + + this.mouse_up = function(position) + { + this.click = null; + } } \ No newline at end of file