[chronojump] Fixed reverse signal on CairoGraphEncoderSignal when screen height is very low
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed reverse signal on CairoGraphEncoderSignal when screen height is very low
- Date: Sun, 10 Apr 2022 10:55:09 +0000 (UTC)
commit cb293bc9e8ea3b7193cc6f4a84486dca26d43e8f
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Apr 10 12:54:31 2022 +0200
Fixed reverse signal on CairoGraphEncoderSignal when screen height is very low
src/gui/cairo/encoder.cs | 5 +++++
src/gui/cairo/xy.cs | 9 +++++++++
2 files changed, 14 insertions(+)
---
diff --git a/src/gui/cairo/encoder.cs b/src/gui/cairo/encoder.cs
index afc58fad2..f07df61c0 100644
--- a/src/gui/cairo/encoder.cs
+++ b/src/gui/cairo/encoder.cs
@@ -41,6 +41,11 @@ public class CairoGraphEncoderSignal : CairoXY
//doing = false;
points_list_painted = 0;
points_list_inertial_painted = 0;
+
+ //need to be small because graphHeight could be 100,
+ //if margins are big then calculatePaintY could give us reverse results
+ outerMargin = 10;
+ innerMargin = 0;
}
//separated in two methods to ensure endGraphDisposing on any return of the other method
diff --git a/src/gui/cairo/xy.cs b/src/gui/cairo/xy.cs
index 72cfa8be8..8380d1c69 100644
--- a/src/gui/cairo/xy.cs
+++ b/src/gui/cairo/xy.cs
@@ -665,6 +665,15 @@ public abstract class CairoXY : CairoGeneric
{
//return graphHeight - totalMargins - ((realY - minY) * (graphHeight - totalMargins -
totalMargins) / (absoluteMaxY - minY));
//to avoid /0 problems (eg raceAnalyzer change person: absoluteMaxY-minY = 0
+
+ /* debug:
+ LogB.Information(string.Format("graphHeight: {0}, totalMargins: {1}, restOfFormula: {2}",
+ graphHeight, totalMargins,
+ (realY - minY) * UtilAll.DivideSafe (
+ graphHeight - totalMargins - totalMargins,
+ absoluteMaxY - minY) ));
+ */
+
return graphHeight - totalMargins - ((realY - minY) * UtilAll.DivideSafe (
graphHeight - totalMargins - totalMargins,
absoluteMaxY - minY));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]