From 3346bd5f0ed976d9d78aee4a77e988f73d65b3ca Mon Sep 17 00:00:00 2001 From: seerge Date: Wed, 12 Apr 2023 14:40:45 +0200 Subject: [PATCH] Fans tip fix --- app/Fans.cs | 21 ++++++++++++--------- app/GHelper.csproj | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/Fans.cs b/app/Fans.cs index 60dddfdc..2fd899e4 100644 --- a/app/Fans.cs +++ b/app/Fans.cs @@ -396,17 +396,19 @@ namespace GHelper Axis ax = ca.AxisX; Axis ay = ca.AxisY; + bool tip = false; + HitTestResult hit = chart.HitTest(e.X, e.Y); if (hit.Series is not null && hit.PointIndex >= 0) + { curPoint = hit.Series.Points[hit.PointIndex]; - else - curPoint = null; + tip = true; + } if (curPoint != null) { - Series s = hit.Series; double dx, dy, dymin; try @@ -428,23 +430,24 @@ namespace GHelper { curPoint.XValue = dx; curPoint.YValues[0] = dy; + tip = true; } - labelTip.Visible = true; labelTip.Text = Math.Round(curPoint.XValue) + "C, " + ChartPercToRPM((int)curPoint.YValues[0], " " + Properties.Strings.RPM); labelTip.Top = e.Y + ((Control)sender).Top; labelTip.Left = e.X; + } catch { Debug.WriteLine(e.Y); - labelTip.Visible = false; + tip = false; } - } else - { - labelTip.Visible = false; - } + } + + labelTip.Visible = tip; + } } diff --git a/app/GHelper.csproj b/app/GHelper.csproj index eb360499..b2e5b1c4 100644 --- a/app/GHelper.csproj +++ b/app/GHelper.csproj @@ -16,7 +16,7 @@ x64 False True - 0.50 + 0.51