[chronojump] forceSensor signal graph resizable



commit 75b065dd68c7a3e6c4c89ec811f973fc1c2b8129
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Dec 26 21:22:17 2017 +0100

    forceSensor signal graph resizable

 src/forceSensor.cs     |   10 ++++++++++
 src/gui/forceSensor.cs |   32 ++++++++++++++++++++++++--------
 2 files changed, 34 insertions(+), 8 deletions(-)
---
diff --git a/src/forceSensor.cs b/src/forceSensor.cs
index d800099..27bb5e8 100644
--- a/src/forceSensor.cs
+++ b/src/forceSensor.cs
@@ -167,6 +167,16 @@ public class ForceSensorCapturePoints
                        //LogB.Information("RedoPOST X: " + Points[i].X.ToString() + "; Y: " + 
Points[i].Y.ToString());
                }
        }
+
+       public int WidthG
+       {
+               set { widthG = value; }
+       }
+
+       public int HeightG
+       {
+               set { heightG = value; }
+       }
 }
 
 public class ForceSensorRFD
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index 3690cd8..a0fb2d4 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -892,8 +892,8 @@ LogB.Information(" fc R ");
        bool force_capture_sizeChanged;
        public void on_force_capture_drawingarea_configure_event(object o, ConfigureEventArgs args)
        {
-//             if(force_capture_drawingarea == null)
-//                     return;
+       if(force_capture_drawingarea == null)
+                       return;
 
                Gdk.EventConfigure ev = args.Event;
                Gdk.Window window = ev.Window;
@@ -908,8 +908,16 @@ LogB.Information(" fc R ");
                        if(forceSensorOtherMode == forceSensorOtherModeEnum.CAPTURE_PRE)
 //                     if(forceCaptureThread != null) //&& capturingCsharp == 
encoderCaptureProcess.CAPTURING)
                                fscPoints.NumPainted = -1; //mark meaning screen should be erased and start 
painting from the beginning
-                       else
-                               UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
+                       else {
+                               if(fscPoints == null)
+                                       UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
+                               else {
+                                       fscPoints.WidthG = allocation.Width;
+                                       fscPoints.HeightG = allocation.Height;
+                                       fscPoints.Redo();
+                                       forceSensorDoSignalGraphPlot();
+                               }
+                       }
 
                        force_capture_sizeChanged = false;
                }
@@ -918,8 +926,8 @@ LogB.Information(" fc R ");
        }
        public void on_force_capture_drawingarea_expose_event(object o, ExposeEventArgs args)
        {
-//             if(force_capture_drawingarea == null)
-//                     return;
+               if(force_capture_drawingarea == null)
+                       return;
 
                /* in some mono installations, configure_event is not called, but expose_event yes.
                 * Do here the initialization
@@ -935,8 +943,16 @@ LogB.Information(" fc R ");
                        if(forceSensorOtherMode == forceSensorOtherModeEnum.CAPTURE_PRE)
                        //if(forceCaptureThread != null) //&& capturingCsharp == 
encoderCaptureProcess.CAPTURING)
                                fscPoints.NumPainted = -1; //mark meaning screen should be erased and start 
painting from the beginning
-                       else
-                               UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
+                       else {
+                               if(fscPoints == null)
+                                       UtilGtk.ErasePaint(force_capture_drawingarea, force_capture_pixmap);
+                               else {
+                                       fscPoints.WidthG = allocation.Width;
+                                       fscPoints.HeightG = allocation.Height;
+                                       fscPoints.Redo();
+                                       forceSensorDoSignalGraphPlot();
+                               }
+                       }
 
                        force_capture_sizeChanged = false;
                }


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