Added guides to brushes.

This commit is contained in:
Devine Lu Linvega 2016-11-15 17:35:15 -08:00
parent b73da6c167
commit 941c9d6575
4 changed files with 21 additions and 4 deletions

View File

@ -79,5 +79,13 @@ $ ! ; Clear temporary storage
#Presets #Presets
##Radial Brush ##Radial Brush
``` ```
# 8 strands
> 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 > 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
# 6 strands
> 600,400 60' 3;> 600,400 120' 3;> 600,400 180' 3;> 600,400 240' 3;> 600,400 300' 3
```
##Symmetry Brush
```
# XY
> 600,400 45' 3
``` ```

View File

@ -43,6 +43,15 @@ function Brush()
this.passive = function(cmd) this.passive = function(cmd)
{ {
if(cmd.rect()){
var x = isNaN(cmd.rect().width) ? 0 : cmd.rect().width;
var y = isNaN(cmd.rect().height) ? 0 : cmd.rect().height;
var pos = new Position(x+","+y);
ronin.overlay.draw(pos);
}
if(cmd.angle() && cmd.position()){
ronin.overlay.draw(cmd.position());
}
} }
this.hint = function(cmd) this.hint = function(cmd)

View File

@ -55,10 +55,10 @@ function Pointer(offset = new Position(), color = new Color('000000'))
return new Position(x + this.offset.x,y + this.offset.y); return new Position(x + this.offset.x,y + this.offset.y);
} }
else if(this.mirror && this.mirror.width > 0){ else if(this.mirror && this.mirror.width > 0){
return new Position(this.mirror.width - (ronin.brush.position.x + this.offset.x), 0 + (ronin.brush.position.y + this.offset.y)); return new Position((2 * this.mirror.width) - (ronin.brush.position.x + this.offset.x), 0 + (ronin.brush.position.y + this.offset.y));
} }
else if(this.mirror && this.mirror.height > 0){ else if(this.mirror && this.mirror.height > 0){
return new Position((ronin.brush.position.x + this.offset.x), this.mirror.height - (ronin.brush.position.y + this.offset.y)); return new Position((ronin.brush.position.x + this.offset.x), (2 * this.mirror.height) - (ronin.brush.position.y + this.offset.y));
} }
return new Position(ronin.brush.position.x + this.offset.x, ronin.brush.position.y + this.offset.y); return new Position(ronin.brush.position.x + this.offset.x, ronin.brush.position.y + this.offset.y);
} }

View File

@ -101,8 +101,8 @@ function Overlay(element)
{ {
this.context().beginPath(); this.context().beginPath();
this.context().moveTo(position.x,0); this.context().moveTo(0,position.y);
this.context().lineTo(position.x,this.element.height); this.context().lineTo(this.element.width,position.y);
this.context().lineCap="round"; this.context().lineCap="round";
this.context().lineWidth = 1; this.context().lineWidth = 1;