[chronojump] ForceSensor zoom working ok



commit 994deb19cd16d35c7ed1b3f9e78833b2378d5d50
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Mar 27 18:00:17 2019 +0100

    ForceSensor zoom working ok

 src/forceSensor.cs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index c34fe968..65d5c5fd 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -291,6 +291,11 @@ public class ForceSensorCapturePoints
                return false;
        }
 
+       public void Zoom(int lastTime) //on zoom adjust width
+       {
+               RealWidthG = lastTime + GetTimeInPx(marginLeft) + GetTimeInPx(marginRight);
+       }
+
        public void Redo()
        {
                for(int i=0; i < NumCaptured; i ++)
@@ -646,6 +651,13 @@ public class ForceSensorAnalyzeInstant
 
                readFile(file, start, end);
 
+               //on zoom adjust width
+               if(start >= 0 || end >= 0)
+               {
+                       fscAIPoints.Zoom(forceSensorValues.TimeLast);
+                       fscAIPoints.Redo();
+               }
+
                //ensure points fit on display
                if(fscAIPoints.OutsideGraph(forceSensorValues.TimeLast, forceSensorValues.ForceMax, 
forceSensorValues.ForceMin))
                        fscAIPoints.Redo();


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