[chronojump] Fixed last commit



commit b8576d2e8eecb139df961a66829f16196706eb23
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Mar 21 17:16:06 2022 +0100

    Fixed last commit

 src/gui/cairo/bars.cs   | 11 +++++------
 src/gui/eventExecute.cs | 28 ++++++++++++++--------------
 2 files changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/gui/cairo/bars.cs b/src/gui/cairo/bars.cs
index a8cf2dda5..633f18f62 100644
--- a/src/gui/cairo/bars.cs
+++ b/src/gui/cairo/bars.cs
@@ -251,7 +251,7 @@ public abstract class CairoBars : CairoGeneric
 
        public abstract void GraphDo (List<PointF> pointMain_l, List<List<PointF>> pointSecondary_ll, bool 
mainAtLeft,
                        List<Cairo.Color> colorMain_l, List<Cairo.Color> colorSecondary, List<string> names_l,
-                       bool showLegend, string labelBarMain, string labelBarSecondary, bool 
labelRotateInFirstBar,
+                       string labelBarMain, string labelBarSecondary, bool labelRotateInFirstBar,
                        int fontHeightForBottomNames, int marginForBottomNames, string title, bool clickable);
 
        protected void initGraph(string font, double widthPercent1)
@@ -792,7 +792,7 @@ public class CairoBars1Series : CairoBars
 
        public override void GraphDo (List<PointF> pointMain_l, List<List<PointF>> pointSecondary_ll, bool 
mainAtLeft,
                        List<Cairo.Color> colorMain_l, List<Cairo.Color> colorSecondary, List<string> names_l,
-                       bool showLegend, string labelBarMain, string labelBarSecondary, bool 
labelRotateInFirstBar,
+                       string labelBarMain, string labelBarSecondary, bool labelRotateInFirstBar,
                        int fontHeightForBottomNames, int marginForBottomNames, string title, bool clickable)
        {
                LogB.Information("at CairoBars1Series.Do");
@@ -801,7 +801,6 @@ public class CairoBars1Series : CairoBars
                this.colorMain_l = colorMain_l;
                //this.colorSecondary_l = colorSecondary_l; //unused in this class
                this.names_l = names_l;
-               //this.showLegend = showLegend; //unused on this class
                this.fontHeightForBottomNames = fontHeightForBottomNames;
                this.marginForBottomNames = marginForBottomNames;
                this.title = title;
@@ -862,9 +861,10 @@ public class CairoBarsNHSeries : CairoBars
        }
 
        //regular constructor
-       public CairoBarsNHSeries (DrawingArea area)
+       public CairoBarsNHSeries (DrawingArea area, bool showLegend)
        {
                this.area = area;
+               this.showLegend = showLegend;
 
                colorSerieA = colorFromGdk(UtilGtk.GetColorShifted(Config.ColorBackground,
                                        ! UtilGtk.ColorIsDark(Config.ColorBackground)));
@@ -1149,7 +1149,7 @@ public class CairoBarsNHSeries : CairoBars
 
        public override void GraphDo (List<PointF> pointMain_l, List<List<PointF>> pointSecondary_ll, bool 
mainAtLeft,
                        List<Cairo.Color> colorMain_l, List<Cairo.Color> colorSecondary_l, List<string> 
names_l,
-                       bool showLegend, string labelBarMain, string labelBarSecondary, bool 
labelRotateInFirstBar,
+                       string labelBarMain, string labelBarSecondary, bool labelRotateInFirstBar,
                        int fontHeightForBottomNames, int marginForBottomNames, string title, bool clickable)
        {
                this.pointSecondary_ll = pointSecondary_ll;
@@ -1157,7 +1157,6 @@ public class CairoBarsNHSeries : CairoBars
                this.colorMain_l = colorMain_l;
                this.colorSecondary_l = colorSecondary_l;
                this.names_l = names_l;
-               this.showLegend = showLegend;
                this.labelBarMain = labelBarMain;
                this.labelBarSecondary = labelBarSecondary;
                this.labelRotateInFirstBar = labelRotateInFirstBar;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index c8b7282d2..5dbce049d 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -2537,7 +2537,7 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
                        UseHeights = false;
 
                if(showBarA && showBarB) //Dja, Djna
-                       cb = new CairoBarsNHSeries (darea);
+                       cb = new CairoBarsNHSeries (darea, true);
                else if (showBarA) //takeOff, takeOffWeight
                        cb = new CairoBars1Series (darea);
                else //rest of the jumps: sj, cmj, ..
@@ -2639,17 +2639,17 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
 
                        cb.GraphDo (pointB_l, pointSecondary_ll, false,
                                        new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                                       true, "", "", false,
+                                       "", "", false,
                                        fontHeightForBottomNames, bottomMargin, title, false);
                } else if (showBarA) //takeOff, takeOffWeight
                        cb.GraphDo (pointA_l, new List<List<PointF>>(), false,
                                        new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                                       false, "", "", false,
+                                       "", "", false,
                                        fontHeightForBottomNames, bottomMargin, title, false);
                else //rest of the jumps: sj, cmj, ..
                        cb.GraphDo (pointB_l, new List<List<PointF>>(), false,
                                        new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                                       false, "", "", false,
+                                       "", "", false,
                                        fontHeightForBottomNames, bottomMargin, title, false);
        }
 }
@@ -2679,7 +2679,7 @@ public class CairoPaintBarsPreJumpReactive : CairoPaintBarsPre
 
        protected override void paintSpecific()
        {
-               cb = new CairoBarsNHSeries (darea);
+               cb = new CairoBarsNHSeries (darea, true);
 
                cb.YVariable = Catalog.GetString("Time");
                cb.YUnits = "s";
@@ -2778,7 +2778,7 @@ public class CairoPaintBarsPreJumpReactive : CairoPaintBarsPre
 
                cb.GraphDo (pointB_l, pointSecondary_ll, false,
                                new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                               true, "", "", false,
+                               "", "", false,
                                fontHeightForBottomNames, bottomMargin, title, false);
        }
 }
@@ -2879,7 +2879,7 @@ public class CairoPaintBarsPreRunSimple : CairoPaintBarsPre
 
                cb.GraphDo (point_l, new List<List<PointF>>(), false,
                                new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                               false, "", "", false,
+                               "", "", false,
                                fontHeightForBottomNames, bottomMargin, title, false);
        }
 }
@@ -2990,7 +2990,7 @@ public class CairoPaintBarsPreRunInterval : CairoPaintBarsPre
 
                cb.GraphDo (point_l, new List<List<PointF>>(), false,
                                new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                               false, "", "", false,
+                               "", "", false,
                                fontHeightForBottomNames, bottomMargin, title, false);
        }
 }
@@ -3064,7 +3064,7 @@ public class CairoPaintBarsPreJumpReactiveRealtimeCapture : CairoPaintBarsPre
                if(tv_l.Count != tc_l.Count)
                        return;
 
-               cb = new CairoBarsNHSeries (darea);
+               cb = new CairoBarsNHSeries (darea, true);
 
                cb.YVariable = Catalog.GetString("Time");
                cb.YUnits = "s";
@@ -3119,7 +3119,7 @@ public class CairoPaintBarsPreJumpReactiveRealtimeCapture : CairoPaintBarsPre
 
                cb.GraphDo (pointB_l, pointSecondary_ll, false,
                                new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                               true, "", "", false,
+                               "", "", false,
                                14, 8, title, false);
        }
 }
@@ -3291,7 +3291,7 @@ public class CairoPaintBarsPreRunIntervalRealtimeCapture : CairoPaintBarsPre
 
                cb.GraphDo (point_l, new List<List<PointF>>(), false,
                                new List<Cairo.Color>(), new List<Cairo.Color>(), names_l,
-                               false, "", "", false,
+                               "", "", false,
                                14, 22, title, false); //22 because there are two rows
        }
 }
@@ -3560,7 +3560,7 @@ public class CairoPaintBarplotPreEncoder : CairoPaintBarsPre
                if(pegbe.eccon == "c")
                        cb = new CairoBars1Series (darea);
                else
-                       cb = new CairoBarsNHSeries (darea);
+                       cb = new CairoBarsNHSeries (darea, false);
 
                //LogB.Information("data_l.Count: " + data_l.Count.ToString());
                //cb.GraphInit(fontStr, true, false); //usePersonGuides, useGroupGuides
@@ -3584,7 +3584,7 @@ public class CairoPaintBarplotPreEncoder : CairoPaintBarsPre
                if(pegbe.eccon == "c")
                        cb.GraphDo (dataA_l, new List<List<PointF>>(), false,
                                        colorMain_l, new List<Cairo.Color>(), names_l,
-                                       false, "", "", false,
+                                       "", "", false,
                                        14, 8, "my title", ! pegbe.capturing);
                else {
                        List<List<PointF>> pointSecondary_ll = new List<List<PointF>>();
@@ -3592,7 +3592,7 @@ public class CairoPaintBarplotPreEncoder : CairoPaintBarsPre
 
                        cb.GraphDo (dataB_l, pointSecondary_ll, false,
                                        colorMain_l, colorSecondary_l, names_l,
-                                       false, "Ecc", "Con", true,
+                                       "Ecc", "Con", true,
                                        14, 8, "my title", ! pegbe.capturing);
                }
        }


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