[genius] Tue Sep 16 16:30:42 2014 Jiri (George) Lebl <jirka 5z com>



commit 303955b6ed3b43c67db4f0bc70c754ebab7893b2
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date:   Tue Sep 16 16:30:46 2014 -0500

    Tue Sep 16 16:30:42 2014  Jiri (George) Lebl <jirka 5z com>
    
        * src/graphing.c:  Fitting dependent axis doesn't work if no
          function is selected, so just ignore fitting when size is negative
          rather than doing undefined things.  The whole thing is a mess,
          we should allow fitting the lines that we draw and such I guess
          not just functions.

 ChangeLog      |    8 ++++++++
 src/graphing.c |   24 ++++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a6c3cdc..71efb2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Sep 16 16:30:42 2014  Jiri (George) Lebl <jirka 5z com>
+
+       * src/graphing.c:  Fitting dependent axis doesn't work if no
+         function is selected, so just ignore fitting when size is negative
+         rather than doing undefined things.  The whole thing is a mess,
+         we should allow fitting the lines that we draw and such I guess
+         not just functions.
+
 Mon Sep 15 13:29:27 2014  Jiri (George) Lebl <jirka 5z com>
 
        * src/compil.c: new string decoding routine interacted with a stupid
diff --git a/src/graphing.c b/src/graphing.c
index 1ea8dfa..97742e4 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -1409,8 +1409,10 @@ plot_zoomfit_cb (void)
 
                if (plot_mode == MODE_LINEPLOT) {
                        size = plot_maxy - plot_miny;
-                       if (size <= 0)
-                               size = 1.0;
+                       if (size <= 0.0) {
+                               /* Just don't do anything */
+                               return;
+                       }
 
                        ploty1 = plot_miny - size * 0.05;
                        ploty2 = plot_maxy + size * 0.05;
@@ -1428,11 +1430,15 @@ plot_zoomfit_cb (void)
                } else if (plot_mode == MODE_LINEPLOT_PARAMETRIC) {
                        double sizex;
                        size = plot_maxy - plot_miny;
-                       if (size <= 0)
-                               size = 1.0;
+                       if (size <= 0.0) {
+                               /* Just don't do anything */
+                               return;
+                       }
                        sizex = plot_maxx - plot_minx;
-                       if (sizex <= 0)
-                               sizex = 1.0;
+                       if (sizex <= 0.0) {
+                               /* Just don't do anything */
+                               return;
+                       }
 
                        plotx1 = plot_minx - sizex * 0.05;
                        plotx2 = plot_maxx + sizex * 0.05;
@@ -1462,8 +1468,10 @@ plot_zoomfit_cb (void)
 
                } else if (plot_mode == MODE_SURFACE) {
                        size = plot_maxz - plot_minz;
-                       if (size <= 0)
-                               size = 1.0;
+                       if (size <= 0.0) {
+                               /* Just don't do anything */
+                               return;
+                       }
                        surfacez1 = plot_minz - size * 0.05;
                        surfacez2 = plot_maxz + size * 0.05;
                        


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]