summaryrefslogtreecommitdiffstats
path: root/share/extensions/funcplot.py
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-11-25 19:41:24 +0000
committerTed Gould <ted@gould.cx>2012-11-25 19:41:24 +0000
commit18be0e5e3ab74823043e19dd6ea46c4b6b130e86 (patch)
treea62925ec4473c1a21e1c99d1415f4cccab59b432 /share/extensions/funcplot.py
parentGetting all the filter headers (diff)
parentFix for 1036059 : Keyboard shortcut editor (diff)
downloadinkscape-18be0e5e3ab74823043e19dd6ea46c4b6b130e86.tar.gz
inkscape-18be0e5e3ab74823043e19dd6ea46c4b6b130e86.zip
Update to current trunk
(bzr r11804.1.8)
Diffstat (limited to 'share/extensions/funcplot.py')
-rwxr-xr-xshare/extensions/funcplot.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py
index a3a810028..08ac15dbb 100755
--- a/share/extensions/funcplot.py
+++ b/share/extensions/funcplot.py
@@ -43,6 +43,9 @@ def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bott
xend = 2 * pi * xend
# coords and scales based on the source rect
+ if xstart == xend:
+ inkex.errormsg(_("x-interval cannot be zero. Please modify 'Start X' or 'End X'"))
+ return []
scalex = width / (xend - xstart)
xoff = left
coordx = lambda x: (x - xstart) * scalex + xoff #convert x-value to coordinate
@@ -52,6 +55,9 @@ def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bott
polar_scalex = width/2.0
coordx = lambda x: x * polar_scalex + centerx #convert x-value to coordinate
+ if ytop == ybottom:
+ inkex.errormsg(_("y-interval cannot be zero. Please modify 'Y top' or 'Y bottom'"))
+ return []
scaley = height / (ytop - ybottom)
yoff = bottom
coordy = lambda y: (ybottom - y) * scaley + yoff #convert y-value to coordinate