diff options
| author | Alvin Penner <penner@vaxxine.com> | 2009-05-24 22:06:36 +0000 |
|---|---|---|
| committer | alvinpenner <alvinpenner@users.sourceforge.net> | 2009-05-24 22:06:36 +0000 |
| commit | 7308701622662672c40bedbff749d8577658a9c2 (patch) | |
| tree | 49b25e7378c8e7bbb942a33cb1f843523113f79f | |
| parent | Slovenian translation update by Martin Srebotnjak (diff) | |
| download | inkscape-7308701622662672c40bedbff749d8577658a9c2.tar.gz inkscape-7308701622662672c40bedbff749d8577658a9c2.zip | |
more robust parsing of color info
(bzr r7927)
| -rwxr-xr-x | share/extensions/dxf_outlines.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py index 6ff0c1a24..3888bc7e3 100755 --- a/share/extensions/dxf_outlines.py +++ b/share/extensions/dxf_outlines.py @@ -150,14 +150,13 @@ class MyEffect(inkex.Effect): h = inkex.unittouu(self.document.getroot().xpath('@height', namespaces=inkex.NSS)[0]) path = '//svg:path' for node in self.document.getroot().xpath(path, namespaces=inkex.NSS): + rgb = (0,0,0) style = node.get('style') - start = style.find("stroke:") - if style[start+11] == ';': - rgb = simplestyle.parseColor(style[(start+7):(start+11)]) - elif style[start+14] == ';': - rgb = simplestyle.parseColor(style[(start+7):(start+14)]) - else: - rgb = (0,0,0) + if style: + style = simplestyle.parseStyle(style) + if style.has_key('stroke'): + if style['stroke'] and style['stroke'] != 'none': + rgb = simplestyle.parseColor(style['stroke']) hsl = coloreffect.ColorEffect.rgb_to_hsl(coloreffect.ColorEffect(),rgb[0]/255.0,rgb[1]/255.0,rgb[2]/255.0) self.color = 7 # default is black if hsl[2]: |
