[chronojump] forceSensor ensure image rfd is enough big to be plot



commit a2c3751ee6dc532e95287fb5103503e3787c839b
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Oct 31 18:46:14 2017 +0100

    forceSensor ensure image rfd is enough big to be plot

 glade/app1.glade       |   23 ++++++++++++++++++++---
 src/gui/forceSensor.cs |   11 ++++++++---
 2 files changed, 28 insertions(+), 6 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 45cf60e..716967e 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1417,6 +1417,9 @@
                                                             <placeholder/>
                                                             </child>
                                                             <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
                                                             <widget class="GtkLabel" 
id="label_start_selector_jumps">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
@@ -10927,7 +10930,7 @@ after time</property>
                                                             <widget class="GtkHPaned" 
id="hpaned_force_capture">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">True</property>
-                                                            <property name="position">400</property>
+                                                            <property name="position">500</property>
                                                             <child>
                                                             <widget class="GtkHBox" id="hbox17">
                                                             <property name="visible">True</property>
@@ -11188,7 +11191,11 @@ after time</property>
                                                             </packing>
                                                             </child>
                                                             <child>
-                                                            <widget class="GtkHBox" id="hbox182">
+                                                            <widget class="GtkHBox" id="hbox_force_rfd">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox231">
                                                             <property name="visible">True</property>
                                                             <property name="can_focus">False</property>
                                                             <property name="spacing">6</property>
@@ -11280,7 +11287,14 @@ after time</property>
                                                             </child>
                                                             </widget>
                                                             <packing>
-                                                            <property name="resize">True</property>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="resize">False</property>
                                                             <property name="shrink">False</property>
                                                             </packing>
                                                             </child>
@@ -21774,6 +21788,9 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
diff --git a/src/gui/forceSensor.cs b/src/gui/forceSensor.cs
index 576d1a1..f83eb90 100644
--- a/src/gui/forceSensor.cs
+++ b/src/gui/forceSensor.cs
@@ -835,9 +835,14 @@ LogB.Information(" fc R ");
                image_force_sensor_graph.Sensitive = false;
 
                ForceSensorGraph fsg = new ForceSensorGraph(rfdList, impulse);
-               bool success = fsg.CallR(
-                               viewport_force_sensor_graph.Allocation.Width -5,
-                               viewport_force_sensor_graph.Allocation.Height -5);
+               int imageWidth = UtilGtk.WidgetWidth(viewport_force_sensor_graph);
+               int imageHeight = UtilGtk.WidgetHeight(viewport_force_sensor_graph);
+               if(imageWidth < 300)
+                       imageWidth = 300; //Not crash R with a png height of -1 or "figure margins too large"
+               if(imageHeight < 300)
+                       imageHeight = 300; //Not crash R with a png height of -1 or "figure margins too large"
+
+               bool success = fsg.CallR(imageWidth -5, imageHeight -5);
 
                if(! success)
                {


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