[genius] Wed Aug 13 18:41:27 2014 Jiri (George) Lebl <jirka 5z com>



commit b0ccc4f20f65c0c4baaa50341f68373f3fc204d6
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date:   Wed Aug 13 18:41:31 2014 -0500

    Wed Aug 13 18:41:27 2014  Jiri (George) Lebl <jirka 5z com>
    
        * src/graphing.c: fix using a single point in LinePlotDrawPoints if
          using a matrix of points.  Also allow null matrix in
          LinePlotDrawPoints and LinePlotDrawLine which makes it a no-op

 ChangeLog      |    6 ++++++
 src/graphing.c |   14 +++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fec33d7..733e6bd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Aug 13 18:41:27 2014  Jiri (George) Lebl <jirka 5z com>
+
+       * src/graphing.c: fix using a single point in LinePlotDrawPoints if
+         using a matrix of points.  Also allow null matrix in
+         LinePlotDrawPoints and LinePlotDrawLine which makes it a no-op
+
 Wed Aug 13 17:06:29 2014  Jiri (George) Lebl <jirka 5z com>
 
         * gtkextra/gtkplotdata.c: Fix drawing data with no connector, then
diff --git a/src/graphing.c b/src/graphing.c
index 04d351b..964c424 100644
--- a/src/graphing.c
+++ b/src/graphing.c
@@ -8191,7 +8191,7 @@ get_line_numbers (GelETree *a, double **x, double **y, int *len,
        }
 
        if (gel_matrixw_width (m) == 2 &&
-           gel_matrixw_height (m) >= 2) {
+           gel_matrixw_height (m) >= minn) {
                *len = gel_matrixw_height (m);
 
                *x = g_new (double, *len);
@@ -8207,7 +8207,7 @@ get_line_numbers (GelETree *a, double **x, double **y, int *len,
                }
        } else if (gel_matrixw_width (m) == 1 &&
                   gel_matrixw_height (m) % 2 == 0 &&
-                  gel_matrixw_height (m) >= 4) {
+                  gel_matrixw_height (m) >= 2*minn) {
                *len = gel_matrixw_height (m) / 2;
 
                *x = g_new (double, *len);
@@ -8223,7 +8223,7 @@ get_line_numbers (GelETree *a, double **x, double **y, int *len,
                }
        } else if (gel_matrixw_height (m) == 1 &&
                   gel_matrixw_width (m) % 2 == 0 &&
-                  gel_matrixw_width (m) >= 4) {
+                  gel_matrixw_width (m) >= 2*minn) {
                *len = gel_matrixw_width (m) / 2;
 
                *x = g_new (double, *len);
@@ -8377,7 +8377,9 @@ LinePlotDrawLine_op (GelCtx *ctx, GelETree * * a, int *exception)
 
        ensure_window (FALSE /* do_window_present */);
 
-       if (a[0]->type == GEL_MATRIX_NODE) {
+       if (a[0]->type == GEL_NULL_NODE) {
+               return gel_makenum_null ();
+       } else if (a[0]->type == GEL_MATRIX_NODE) {
                if G_UNLIKELY ( ! get_line_numbers (a[0], &x, &y, &len,
                                                    &minx, &maxx, &miny, &maxy,
                                                    "LinePlotDrawLine",
@@ -8656,7 +8658,9 @@ LinePlotDrawPoints_op (GelCtx *ctx, GelETree * * a, int *exception)
 
        ensure_window (FALSE /* do_window_present */);
 
-       if (a[0]->type == GEL_MATRIX_NODE) {
+       if (a[0]->type == GEL_NULL_NODE) {
+               return gel_makenum_null ();
+       } else if (a[0]->type == GEL_MATRIX_NODE) {
                if G_UNLIKELY ( ! get_line_numbers (a[0], &x, &y, &len,
                                                    &minx, &maxx, &miny, &maxy,
                                                    "LinePlotDrawPoints",


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