[chronojump] CairoGraphRaceAnalyzer bars same color and outline than sprintEncoder model bars
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] CairoGraphRaceAnalyzer bars same color and outline than sprintEncoder model bars
- Date: Tue, 10 May 2022 09:29:41 +0000 (UTC)
commit 3733303df6be4090d6a09cccfcbe04a61e61d0c6
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue May 10 11:29:00 2022 +0200
CairoGraphRaceAnalyzer bars same color and outline than sprintEncoder model bars
src/gui/cairo/raceAnalyzer.cs | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/cairo/raceAnalyzer.cs b/src/gui/cairo/raceAnalyzer.cs
index 235545cb9..d7d614446 100644
--- a/src/gui/cairo/raceAnalyzer.cs
+++ b/src/gui/cairo/raceAnalyzer.cs
@@ -169,13 +169,14 @@ public class CairoGraphRaceAnalyzer : CairoXY
if(plotPowerBars)
{
- g.SetSourceColor (colorFromRGB (66,66,66));
+ g.SetSourceColor (colorFromRGB (190,190,190));
double powerPropAt0 = MathUtil.GetProportion (0,
segmentCalcs.Power_l);
//draw Y0 line
g.MoveTo (outerMargin, calculatePaintYProportion
(powerPropAt0));
g.LineTo (calculatePaintX (points_list[points_list.Count
-1].X), calculatePaintYProportion (powerPropAt0));
g.Stroke ();
+ g.SetSourceColor (black);
printText(calculatePaintX (points_list[points_list.Count
-1].X), calculatePaintYProportion (powerPropAt0),
0, textHeight-3, " 0 " + powerStr, g,
alignTypes.LEFT);
@@ -192,15 +193,21 @@ public class CairoGraphRaceAnalyzer : CairoXY
xStart = calculatePaintX
(segmentCalcs.Time_l[i-1]/1000000.0);
double xEnd = calculatePaintX
(segmentCalcs.Time_l[i]/1000000.0);
+ g.SetSourceColor (colorFromRGB (190,190,190));
g.Rectangle (xStart, //x
calculatePaintYProportion
(powerPropAt0), //y
xEnd - xStart, //width
calculatePaintYProportion (powerProp)
- calculatePaintYProportion (powerPropAt0) );
- g.Fill();
+
+ g.FillPreserve(); //fill preparing for border later
+ g.SetSourceColor (colorFromRGB (66,66,66));
+ g.Stroke(); //rectangle border
int textPadding = 1;
if(segmentCalcs.Power_l[i] < 0)
textPadding = -1;
+
+ g.SetSourceColor (black);
printText((xStart + xEnd) / 2,
calculatePaintYProportion (powerProp) - (textHeight) * textPadding,
0, textHeight-3,
Math.Round(segmentCalcs.Power_l[i],1).ToString() + " W", g, alignTypes.CENTER);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]