[chronojump] Encoder saved repetitions calculation on barplot now works ok on ec



commit 1aabc907789c3fdfa1d7153f67c67c81cea9bde3
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Sep 19 17:00:45 2016 +0200

    Encoder saved repetitions calculation on barplot now works ok on ec

 src/gui/encoder.cs |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index cfbe645..9603f2b 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -4278,8 +4278,16 @@ public partial class ChronoJumpWindow
                                                        dLeft, dTop, dLeft + dWidth, dBottom);
                        }
                        
+                       bool curveSaved = false;        
+                       if( iterOk && ((EncoderCurve) encoderCaptureListStore.GetValue (iter, 0)).Record ) {
+                               curveSaved = true;
+                               sumSaved += dFor;
+                               countSaved ++;
+                       }
+                       
                        //add text on the bottom
-                       if (eccon == "c" || Util.IsEven(count +1)) { //par
+                       if (eccon == "c" || Util.IsEven(count +1)) //par
+                       {
                                int startX = Convert.ToInt32(dLeft + dWidth/2);
                                string bottomText = (count +1).ToString();
                                if (eccon != "c") {
@@ -4293,17 +4301,11 @@ public partial class ChronoJumpWindow
                                layout_encoder_capture_curves_bars.GetPixelSize(out textWidth, out 
textHeight); 
                                int myX = Convert.ToInt32( startX - textWidth/2);
                                int myY = Convert.ToInt32(dTop + dHeight + (bottom_margin /2) - textHeight/2);
-                               
-                               //plot a rectangle if this curve it is saved
-                               if(iterOk)
-                                       if(((EncoderCurve) encoderCaptureListStore.GetValue (iter, 
0)).Record) {
-                                               rect = new Rectangle(myX -2, myY -1, textWidth +4, 
graphHeight - (myY -1) -1);
-                                               
encoder_capture_curves_bars_pixmap.DrawRectangle(pen_selected_encoder_capture, false, rect);
-
-                                               //average of saved values
-                                               sumSaved += dFor;
-                                               countSaved ++;
-                                       }
+                       
+                               if(curveSaved) {
+                                       rect = new Rectangle(myX -2, myY -1, textWidth +4, graphHeight - (myY 
-1) -1);
+                                       
encoder_capture_curves_bars_pixmap.DrawRectangle(pen_selected_encoder_capture, false, rect);
+                               }
                                
                                //write the text
                                encoder_capture_curves_bars_pixmap.DrawLayout (pen_black_encoder_capture, 
@@ -4311,8 +4313,6 @@ public partial class ChronoJumpWindow
                                                layout_encoder_capture_curves_bars);
                        }
 
-
-
                        count ++;
                        iterOk = encoderCaptureListStore.IterNext (ref iter);
                }


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