diff options
Diffstat (limited to 'share/extensions/funcplot.py')
| -rwxr-xr-x | share/extensions/funcplot.py | 6 |
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 |
