From ab7cfa2aa956a47c52fddd5f89235114ed958ce4 Mon Sep 17 00:00:00 2001 From: JazzyNico Date: Tue, 31 Aug 2010 08:56:30 +0200 Subject: [PATCH] Extensions. Number dots improvements (Bug #615313). --- share/extensions/dots.inx | 18 ++++++++++++++++-- share/extensions/dots.py | 18 ++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/share/extensions/dots.inx b/share/extensions/dots.inx index 4655f838b..1eca17030 100644 --- a/share/extensions/dots.inx +++ b/share/extensions/dots.inx @@ -4,8 +4,22 @@ org.ekips.filter.dots dots.py inkex.py - 20 - 10px + + + 20 + 10px + 1 + 1 + + + <_param name="instructions" type="description" xml:space="preserve">This extension replaces the selection's nodes with numbered dots according to the following options: + * Font size: size of the node number labels. + * Dot size: diameter of the dots placed at path nodes. + * Starting dot number: first number in the sequence, assigned to the first node of the path. + * Step: numbering step between two nodes. + + + path diff --git a/share/extensions/dots.py b/share/extensions/dots.py index aa33b39ac..eb4aabd84 100755 --- a/share/extensions/dots.py +++ b/share/extensions/dots.py @@ -22,6 +22,9 @@ class Dots(inkex.Effect): def __init__(self): inkex.Effect.__init__(self) + self.OptionParser.add_option("--tab", + action="store", type="string", + dest="tab") self.OptionParser.add_option("-d", "--dotsize", action="store", type="string", dest="dotsize", default="10px", @@ -30,8 +33,15 @@ class Dots(inkex.Effect): action="store", type="string", dest="fontsize", default="20", help="Size of node label numbers") - - + self.OptionParser.add_option("-s", "--start", + action="store", type="int", + dest="start", default="1", + help="First number in the sequence, assigned to the first node") + self.OptionParser.add_option("-t", "--step", + action="store", type="int", + dest="step", default="1", + help="Numbering step between two nodes") + def separateLastAndFirst(self, p): # Separate the last and first dot if they are togheter lastDot = -1 @@ -72,7 +82,7 @@ class Dots(inkex.Effect): self.separateLastAndFirst(p) - num = 1 + num = self.options.start for cmd,params in p: if cmd != 'Z' and cmd != 'z': dot_att = { @@ -90,7 +100,7 @@ class Dots(inkex.Effect): params[-2] + ( inkex.unittouu(self.options.dotsize) / 2 ), params[-1] - ( inkex.unittouu(self.options.dotsize) / 2 ), num ) - num += 1 + num += self.options.step node.getparent().remove( node ) -- 2.30.2