[chronojump] Fixes last commit



commit f80e248bcb81e5d7164b0d50693d033b0f900ba5
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu May 7 23:33:39 2015 +0200

    Fixes last commit

 encoder/graph.R |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/encoder/graph.R b/encoder/graph.R
index 792970d..a533b45 100644
--- a/encoder/graph.R
+++ b/encoder/graph.R
@@ -279,14 +279,23 @@ findCurvesNew <- function(displacement, eccon, min_height, draw, title)
 
              count = count +1
        }
+       
        #if eccon it's 'ec' and last row it's 'e', delete it
-       if(count > 1 && ( position[startCurrent] > position[endCurrent] ) )
+       if(count > 1)
        {
-               write("deleting last ecc row", stderr())
-               startStored = startStored[-length(startStored)]
-               endStored = endStored[-length(endStored)]
-               startHStored = startHStored[-length(startHStored)]
+               startStoredLast = startStored[length(startStored)]
+               endStoredLast = endStored[length(endStored)]
 
+               #write("startStoredLast, endStoredLast", stderr())
+               #write(c(startStoredLast, endStoredLast), stderr())
+               
+               if ( position[startStoredLast] > position[endStoredLast] ) 
+               {
+                       write("deleting last ecc row", stderr())
+                       startStored = startStored[-length(startStored)]
+                       endStored = endStored[-length(endStored)]
+                       startHStored = startHStored[-length(startHStored)]
+               }
        }
 
        #if eccon == "ec" mix 'e' and 'c' curves


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