From c3b68a41ca9bdc16e17a979a2394d331c8b5265e Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Fri, 3 Aug 2018 12:57:36 +1200 Subject: [PATCH] Implemented mirrors --- desktop/sources/scripts/tool.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/desktop/sources/scripts/tool.js b/desktop/sources/scripts/tool.js index f207782..cf19ac7 100644 --- a/desktop/sources/scripts/tool.js +++ b/desktop/sources/scripts/tool.js @@ -167,20 +167,32 @@ function Tool() this.i.linecap += mod; this.style().strokeLinecap = a[this.i.linecap % a.length]; } - if(type == "linejoin"){ + else if(type == "linejoin"){ var a = ["miter","round","bevel"]; this.i.linejoin += mod; 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"; } - if(type == "thickness"){ + else if(type == "thickness"){ 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(); } + this.misc = function(type) + { + dotgrid.picker.start(); + } + this.can_append = function(content) { for(id in this.layer()){ @@ -259,16 +271,6 @@ function Tool() 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 this.style = function()