diff --git a/editor/svg-editor.js b/editor/svg-editor.js index b2a54afd..a5c2e9b4 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -130,8 +130,10 @@ $(document).ready(function(){ $('.tools_flyout').hide(); var oldbg = elem.css('background'); var color = elem.css('background-color'); + var was_none = false; if (color == 'transparent') { color = new $.jPicker.Color({ hex: 'ffffff' }); + was_none = true; } else { if (color.length == 7 && color[0] == '#') { // #hheexx notation color = new $.jPicker.Color( { hex: color.substring(1,7) } ); @@ -158,6 +160,13 @@ $(document).ready(function(){ } , null, function(){ elem.css('background', oldbg); + if (was_none) { + if (elem.attr('id') == 'stroke_color') { + SvgCanvas.setStrokeColor('none'); + } else if (elem.attr('id') == 'fill_color') { + SvgCanvas.setFillColor('none'); + } + } $('#color_picker').hide(); }); } diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index c0ebd9e1..40d7d6f3 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -465,34 +465,66 @@ function SvgCanvas(doc) } } + this.getMode = function() { + return current_mode; + } + this.setMode = function(name) { current_mode = name; } + this.getStrokeColor = function() { + return current_stroke; + } + this.setStrokeColor = function(color) { current_stroke = color; } + this.getFillColor = function() { + return current_fill; + } + this.setFillColor = function(color) { current_fill = color; } + this.getStrokeWidth = function() { + return current_stroke_width; + } + this.setStrokeWidth = function(val) { current_stroke_width = val; } + this.getStrokeStyle = function() { + return current_stroke_style; + } + this.setStrokeStyle = function(val) { current_stroke_style = val; } + this.getOpacity = function() { + return current_opacity; + } + this.setOpacity = function(val) { current_opacity = val; } + this.getFillOpacity = function() { + return current_fill_opacity; + } + this.setFillOpacity = function(val) { current_fill_opacity = val; } + this.getStrokeOpacity = function() { + return current_stroke_opacity; + } + this.setStrokeOpacity = function(val) { current_stroke_opacity = val; }