From b73da6c167b14af885bdbe1150daf02814baabc3 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Tue, 15 Nov 2016 13:29:31 -0800 Subject: [PATCH] Added some presets to README.md --- README.md | 6 ++++++ index.html | 4 ++-- scripts/keyboard.js | 4 ++++ scripts/ronin.brush.pointer.js | 7 +++---- scripts/ronin.canvas.js | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b0161eb..36d242a 100644 --- a/README.md +++ b/README.md @@ -74,4 +74,10 @@ $ ! ; Clear temporary storage #ff0000 ; color: red ?5 ; random: 0..5 45' ; degree: 45/365 +``` + +#Presets +##Radial Brush +``` +> 600,400 45' 3;> 600,400 90' 3;> 600,400 135' 3;> 600,400 180' 3;> 600,400 225' 3;> 600,400 270' 3;> 600,400 315' 3 ``` \ No newline at end of file diff --git a/index.html b/index.html index 3d237e0..f8fe29e 100644 --- a/index.html +++ b/index.html @@ -22,8 +22,8 @@
- - + +
Hey
diff --git a/scripts/keyboard.js b/scripts/keyboard.js index 1e1aaf7..5fe2ca4 100644 --- a/scripts/keyboard.js +++ b/scripts/keyboard.js @@ -69,6 +69,10 @@ function Keyboard() if(multi[1]){commander.active(multi[1].split(" "));} if(multi[2]){commander.active(multi[2].split(" "));} if(multi[3]){commander.active(multi[3].split(" "));} + if(multi[4]){commander.active(multi[4].split(" "));} + if(multi[5]){commander.active(multi[5].split(" "));} + if(multi[6]){commander.active(multi[6].split(" "));} + if(multi[7]){commander.active(multi[7].split(" "));} } else{ commander.active(cmd.split(" ")); diff --git a/scripts/ronin.brush.pointer.js b/scripts/ronin.brush.pointer.js index 38ef231..948a716 100644 --- a/scripts/ronin.brush.pointer.js +++ b/scripts/ronin.brush.pointer.js @@ -45,14 +45,13 @@ function Pointer(offset = new Position(), color = new Color('000000')) this.position = function() { if(this.angle){ - + var angle_radian = this.angle * Math.PI / 180; var deltaX = ronin.brush.position.x - this.offset.x; var deltaY = ronin.brush.position.y - this.offset.y; - var t = Math.atan2(deltaY, deltaX); - var radius = 45; + var t = Math.atan2(deltaY, deltaX) + angle_radian; + var radius = ronin.brush.position.distance_to(this.offset); var x = Math.cos(t) * radius; var y = Math.sin(t) * radius; - return new Position(x + this.offset.x,y + this.offset.y); } else if(this.mirror && this.mirror.width > 0){ diff --git a/scripts/ronin.canvas.js b/scripts/ronin.canvas.js index cb67fc6..3ba07d0 100644 --- a/scripts/ronin.canvas.js +++ b/scripts/ronin.canvas.js @@ -6,7 +6,7 @@ function Canvas(element) this.active = function(cmd) { - if(cmd.bang()){ clear(); } + if(cmd.bang()){ this.clear(); } if(cmd.rect()){ this.resize(cmd.rect());