Implemented mirrors
This commit is contained in:
@@ -167,20 +167,32 @@ function Tool()
|
|||||||
this.i.linecap += mod;
|
this.i.linecap += mod;
|
||||||
this.style().strokeLinecap = a[this.i.linecap % a.length];
|
this.style().strokeLinecap = a[this.i.linecap % a.length];
|
||||||
}
|
}
|
||||||
if(type == "linejoin"){
|
else if(type == "linejoin"){
|
||||||
var a = ["miter","round","bevel"];
|
var a = ["miter","round","bevel"];
|
||||||
this.i.linejoin += mod;
|
this.i.linejoin += mod;
|
||||||
this.style().strokeLinejoin = a[this.i.linejoin % a.length];
|
this.style().strokeLinejoin = a[this.i.linejoin % a.length];
|
||||||
}
|
}
|
||||||
if(type == "fill"){
|
else if(type == "fill"){
|
||||||
this.style().fill = this.style().fill == "none" ? this.style().color : "none";
|
this.style().fill = this.style().fill == "none" ? this.style().color : "none";
|
||||||
}
|
}
|
||||||
if(type == "thickness"){
|
else if(type == "thickness"){
|
||||||
this.style().thickness = clamp(this.style().thickness+mod,1,40);
|
this.style().thickness = clamp(this.style().thickness+mod,1,40);
|
||||||
}
|
}
|
||||||
|
else if(type == "mirror"){
|
||||||
|
this.style().mirror_style = this.style().mirror_style > 3 ? 0 : this.style().mirror_style+1;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
console.warn("Unknown",type)
|
||||||
|
}
|
||||||
|
dotgrid.interface.refresh(true);
|
||||||
dotgrid.guide.refresh();
|
dotgrid.guide.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.misc = function(type)
|
||||||
|
{
|
||||||
|
dotgrid.picker.start();
|
||||||
|
}
|
||||||
|
|
||||||
this.can_append = function(content)
|
this.can_append = function(content)
|
||||||
{
|
{
|
||||||
for(id in this.layer()){
|
for(id in this.layer()){
|
||||||
@@ -259,16 +271,6 @@ function Tool()
|
|||||||
dotgrid.guide.refresh();
|
dotgrid.guide.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Toggles
|
|
||||||
|
|
||||||
this.toggle_mirror = function()
|
|
||||||
{
|
|
||||||
this.style().mirror_style = this.style().mirror_style > 3 ? 0 : this.style().mirror_style+1;
|
|
||||||
|
|
||||||
dotgrid.guide.refresh();
|
|
||||||
dotgrid.interface.refresh(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Style
|
// Style
|
||||||
|
|
||||||
this.style = function()
|
this.style = function()
|
||||||
|
|||||||
Reference in New Issue
Block a user