rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

Can not initialize with fill color : none so that fill is transparent #874

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Set in svg-editor.js a initialization fill color of none
svgEditor.setConfig({
    initFill: {
        color: "none",
        opacity: .75
    }
2.On the url add the initfill color command so that it is none

What is the expected output? What do you see instead?

The fill color when we draw a rectangle should then be transparent. When I look 
in the produced svg file I see that the color is '#none' instead of 'none'. 

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)

All

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1, etc)

2.6.1

Please provide any additional information below.

To fix the problem, change svgcanvas.js as follow according to the three 
comment added here:

// Object containing data for the currently selected styles
if (curConfig.initFill.color != "none") goodcolor = "#" + 
curConfig.initFill.color; // added line
else goodcolor = curConfig.initFill.color; // added line

var all_properties = {
    shape: {
fill: goodcolor,
fill_paint: null,   // modified line

See my attache file.

Original issue reported on code.google.com by fbs1...@gmail.com on 2 Nov 2011 at 12:48

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by fbs1...@gmail.com on 2 Nov 2011 at 4:16

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch.  Can you just make a patch against the svn trunk so that 
I can try to apply it cleanly?

$ svn diff > yourpatch.txt

Original comment by codedr...@gmail.com on 3 Nov 2011 at 1:56

GoogleCodeExporter commented 9 years ago
Fixed in r2070. However transparent now is a bit buggy, refer issue 935.

Original comment by asyazwan on 26 Mar 2012 at 1:34