[chronojump] jumpsRjFatigue with x grid as integers
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] jumpsRjFatigue with x grid as integers
- Date: Thu, 6 Aug 2020 15:20:40 +0000 (UTC)
commit bb030b6092abf677b986143278dfe788ee16c5c4
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Aug 6 17:20:18 2020 +0200
jumpsRjFatigue with x grid as integers
src/gui/cairo/jumpsDjOptimalFall.cs | 2 +-
src/gui/cairo/jumpsEvolution.cs | 2 +-
src/gui/cairo/jumpsRjFatigue.cs | 3 ++-
src/gui/cairo/jumpsWeightFVProfile.cs | 2 +-
src/gui/cairo/xy.cs | 9 ++++++---
5 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/gui/cairo/jumpsDjOptimalFall.cs b/src/gui/cairo/jumpsDjOptimalFall.cs
index 34095b4d..b6962fd6 100644
--- a/src/gui/cairo/jumpsDjOptimalFall.cs
+++ b/src/gui/cairo/jumpsDjOptimalFall.cs
@@ -74,7 +74,7 @@ public class JumpsDjOptimalFallGraph : CairoXY
findPointMaximums(false);
findAbsoluteMaximums();
- paintAxisAndGrid(gridTypes.BOTH);
+ paintAxisAndGrid(gridTypes.BOTH, true);
LogB.Information(string.Format("coef length:{0}", coefs.Length));
if(coefs.Length == 3)
diff --git a/src/gui/cairo/jumpsEvolution.cs b/src/gui/cairo/jumpsEvolution.cs
index 380ddcaf..bb1e7cd7 100644
--- a/src/gui/cairo/jumpsEvolution.cs
+++ b/src/gui/cairo/jumpsEvolution.cs
@@ -67,7 +67,7 @@ public class JumpsEvolutionGraph : CairoXY
findPointMaximums(false);
//findAbsoluteMaximums();
- paintAxisAndGrid(gridTypes.HORIZONTALLINES);
+ paintAxisAndGrid(gridTypes.HORIZONTALLINES, true);
paintGridDatetime();
plotPredictedLine(predictedLineTypes.STRAIGHT, predictedLineCrossMargins.TOUCH);
diff --git a/src/gui/cairo/jumpsRjFatigue.cs b/src/gui/cairo/jumpsRjFatigue.cs
index 118dad34..268f5cfc 100644
--- a/src/gui/cairo/jumpsRjFatigue.cs
+++ b/src/gui/cairo/jumpsRjFatigue.cs
@@ -67,7 +67,8 @@ public class JumpsRjFatigueGraph : CairoXY
findPointMaximums(false);
//findAbsoluteMaximums();
- paintAxisAndGrid(gridTypes.HORIZONTALLINES);
+ paintAxisAndGrid(gridTypes.HORIZONTALLINES, true);
+ paintAxisAndGrid(gridTypes.VERTICALLINES, false);
plotPredictedLine(predictedLineTypes.STRAIGHT, predictedLineCrossMargins.TOUCH);
plotRealPoints(true);
diff --git a/src/gui/cairo/jumpsWeightFVProfile.cs b/src/gui/cairo/jumpsWeightFVProfile.cs
index 4593e250..ea693687 100644
--- a/src/gui/cairo/jumpsWeightFVProfile.cs
+++ b/src/gui/cairo/jumpsWeightFVProfile.cs
@@ -132,7 +132,7 @@ public class JumpsWeightFVProfileGraph : CairoXY
findPointMaximums(false);
//findAbsoluteMaximums();
- paintAxisAndGrid(gridTypes.BOTH);
+ paintAxisAndGrid(gridTypes.BOTH, true);
if(showFullGraph)
plotPredictedLine(predictedLineTypes.STRAIGHT, predictedLineCrossMargins.CROSS);
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index a4d3fab4..fa037685 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -259,12 +259,15 @@ public abstract class CairoXY
}
}
- protected void paintAxisAndGrid(gridTypes gridType)
+ protected void paintAxisAndGrid(gridTypes gridType, bool niceAutoValues)
{
g.LineWidth = 1; //to allow to be shown the red arrows on jumpsWeightFVProfile
//1 paint grid
- paintGrid (minX, absoluteMaxX, minY, absoluteMaxY, 5, gridType);
+ if(niceAutoValues)
+ paintGridNiceAutoValues (minX, absoluteMaxX, minY, absoluteMaxY, 5, gridType);
+ else
+ paintGridInt (minX, absoluteMaxX, minY, absoluteMaxY, 1, gridType);
//2 paint axis (to show axis on overlap)
g.MoveTo(outerMargins, outerMargins);
@@ -544,7 +547,7 @@ public abstract class CairoXY
//TODO: fix if min == max (crashes)
protected enum gridTypes { BOTH, HORIZONTALLINES, VERTICALLINES }
- protected void paintGrid (double minX, double maxX, double minY, double maxY, int seps, gridTypes
gridType)
+ protected void paintGridNiceAutoValues (double minX, double maxX, double minY, double maxY, int seps,
gridTypes gridType)
{
var gridXTuple = getGridStepAndBoundaries ((decimal) minX, (decimal) maxX, seps);
var gridYTuple = getGridStepAndBoundaries ((decimal) minY, (decimal) maxY, seps);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]