summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2013-01-01 18:24:47 +0000
committer~suv <suv-sf@users.sourceforge.net>2013-01-01 18:24:47 +0000
commit0b3b386881da011ac7ee60dd20bd610fd9670677 (patch)
tree59d08dfb788ebbe333fa21140fcd8203faadc356 /share/extensions
parentmerge from trunk (r11952) (diff)
parentclip path visual bbox refresh, second try (Bug 1005085) (diff)
downloadinkscape-0b3b386881da011ac7ee60dd20bd610fd9670677.tar.gz
inkscape-0b3b386881da011ac7ee60dd20bd610fd9670677.zip
merge from trunk (r12005)
(bzr r11668.1.47)
Diffstat (limited to 'share/extensions')
-rw-r--r--share/extensions/funcplot.inx1
-rwxr-xr-xshare/extensions/funcplot.py15
-rwxr-xr-xshare/extensions/text_braille.py3
3 files changed, 18 insertions, 1 deletions
diff --git a/share/extensions/funcplot.inx b/share/extensions/funcplot.inx
index 8eaf33f01..58cf158ca 100644
--- a/share/extensions/funcplot.inx
+++ b/share/extensions/funcplot.inx
@@ -41,6 +41,7 @@ The constants pi and e are also available.</_param>
<param name="fofx" type="string" _gui-text="Function:">exp(-x*x)</param>
<param name="fponum" type="boolean" _gui-text="Calculate first derivative numerically">true</param>
<param name="fpofx" type="string" _gui-text="First derivative:">x</param>
+ <param name="clip" type="boolean" _gui-text="Clip with rectangle">false</param>
<param name="remove" type="boolean" _gui-text="Remove rectangle">true</param>
<param name="drawaxis" type="boolean" _gui-text="Draw Axes">false</param>
<param name="endpts" type="boolean" _gui-text="Add x-axis endpoints">false</param>
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py
index 08ac15dbb..7f8fdafe1 100755
--- a/share/extensions/funcplot.py
+++ b/share/extensions/funcplot.py
@@ -28,6 +28,7 @@ Changes:
# standard library
from math import *
from random import *
+from copy import deepcopy
# local library
import inkex
import simplepath
@@ -217,6 +218,10 @@ class FuncPlot(inkex.Effect):
action="store", type="string",
dest="fpofx", default="cos(x)",
help="f'(x) for plotting")
+ self.OptionParser.add_option("--clip",
+ action="store", type="inkbool",
+ dest="clip", default=False,
+ help="If True, clip with copy of source rectangle")
self.OptionParser.add_option("--remove",
action="store", type="inkbool",
dest="remove", default=True,
@@ -293,6 +298,16 @@ class FuncPlot(inkex.Effect):
# add path into SVG structure
node.getparent().append(newpath)
+ # option whether to clip the path with rect or not.
+ if self.options.clip:
+ defs = self.xpathSingle('/svg:svg//svg:defs')
+ if defs == None:
+ defs = inkex.etree.SubElement(self.document.getroot(),inkex.addNS('defs','svg'))
+ clip = inkex.etree.SubElement(defs,inkex.addNS('clipPath','svg'))
+ clip.append(deepcopy(node))
+ clipId = self.uniqueId('clipPath')
+ clip.set('id', clipId)
+ newpath.set('clip-path', 'url(#'+clipId+')')
# option wether to remove the rectangle or not.
if self.options.remove:
node.getparent().remove(node)
diff --git a/share/extensions/text_braille.py b/share/extensions/text_braille.py
index 09300f891..ba2e3d81b 100755
--- a/share/extensions/text_braille.py
+++ b/share/extensions/text_braille.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-#encoding: utf-8
+# -*- coding: utf-8 -*-
+
import chardataeffect, inkex, string
convert_table = {\