diff options
| author | Alvin Penner <penner@vaxxine.com> | 2012-10-23 21:40:02 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2012-10-23 21:40:02 +0000 |
| commit | 398b8c550b6ece8e389cf263615c6463c50bbf0f (patch) | |
| tree | a76bd88332ee828428dfe738823bb67eefd19ea7 /share/extensions/funcplot.py | |
| parent | Use Gtk::Box to arrange layer dialog buttons. Prevents oversized buttons in ... (diff) | |
| download | inkscape-398b8c550b6ece8e389cf263615c6463c50bbf0f.tar.gz inkscape-398b8c550b6ece8e389cf263615c6463c50bbf0f.zip | |
extensions. function plotter. prevent divide by zero. (Bug 1064863)
Fixed bugs:
- https://launchpad.net/bugs/1064863
(bzr r11824)
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 |
