diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2010-08-31 06:56:30 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2010-08-31 06:56:30 +0000 |
| commit | bae2bf5923b4fe81d3e686b6880e6ee88845ccaa (patch) | |
| tree | 6a1cc057e5193f38e8334903ceab8fa46a60c00c | |
| parent | Extensions. Shebangs branch merge. (diff) | |
| download | inkscape-bae2bf5923b4fe81d3e686b6880e6ee88845ccaa.tar.gz inkscape-bae2bf5923b4fe81d3e686b6880e6ee88845ccaa.zip | |
Extensions. Number dots improvements (Bug #615313).
(bzr r9735)
| -rw-r--r-- | share/extensions/dots.inx | 18 | ||||
| -rwxr-xr-x | 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 @@ <id>org.ekips.filter.dots</id> <dependency type="executable" location="extensions">dots.py</dependency> <dependency type="executable" location="extensions">inkex.py</dependency> - <param name="fontsize" type="string" _gui-text="Font size">20</param> - <param name="dotsize" type="string" _gui-text="Dot size">10px</param> + <param name="tab" type="notebook"> + <page name="Options" _gui-text="Options"> + <param name="fontsize" type="string" _gui-text="Font size:">20</param> + <param name="dotsize" type="string" _gui-text="Dot size:">10px</param> + <param name="start" type="int" min="0" max="1000" _gui-text="Starting dot number:">1</param> + <param name="step" type="int" min="0" max="1000" _gui-text="Step:">1</param> + </page> + <page name="Help" _gui-text="Help"> + <_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.</_param> + </page> + </param> + <effect> <object-type>path</object-type> <effects-menu> 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 ) |
