summaryrefslogtreecommitdiffstats
path: root/share/extensions/convert2dashes.py
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-03-08 16:56:44 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-03-08 16:56:44 +0000
commit7e306ee20d7adc76d2c3a038434f22d51af3498a (patch)
tree57088551477b8efee68bdb0c9fcbd91717e5d0ba /share/extensions/convert2dashes.py
parentallow use multiple lines, added new icon (diff)
parentFixed icons files to save circles without 'd' atribute pointed by su_v (diff)
downloadinkscape-7e306ee20d7adc76d2c3a038434f22d51af3498a.tar.gz
inkscape-7e306ee20d7adc76d2c3a038434f22d51af3498a.zip
fixing icons and update to trunk
(bzr r13973.1.4)
Diffstat (limited to 'share/extensions/convert2dashes.py')
-rwxr-xr-xshare/extensions/convert2dashes.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/share/extensions/convert2dashes.py b/share/extensions/convert2dashes.py
index 9e7f6d439..1228b247c 100755
--- a/share/extensions/convert2dashes.py
+++ b/share/extensions/convert2dashes.py
@@ -54,17 +54,24 @@ class SplitIt(inkex.Effect):
for id, node in self.selected.iteritems():
if node.tag == inkex.addNS('path','svg'):
dashes = []
+ offset = 0
style = simplestyle.parseStyle(node.get('style'))
if style.has_key('stroke-dasharray'):
if style['stroke-dasharray'].find(',') > 0:
dashes = [float (dash) for dash in style['stroke-dasharray'].split(',')]
+ if style.has_key('stroke-dashoffset'):
+ offset = style['stroke-dashoffset']
if dashes:
p = cubicsuperpath.parsePath(node.get('d'))
new = []
for sub in p:
idash = 0
dash = dashes[0]
- length = 0
+ length = float (offset)
+ while dash < length:
+ length = length - dash
+ idash = (idash + 1) % len(dashes)
+ dash = dashes[idash]
new.append([sub[0][:]])
i = 1
while i < len(sub):