Skip to content

Commit

Permalink
Boost dropdown fix
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Apr 12, 2023
1 parent 08e1ed5 commit 6d0bb5b
Show file tree
Hide file tree
Showing 4 changed files with 453 additions and 42 deletions.
72 changes: 39 additions & 33 deletions app/Fans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,56 +390,62 @@ private void ChartCPU_MouseMove(object? sender, MouseEventArgs e)
{

if (sender is null) return;

Chart chart = (Chart)sender;

if (e.Button.HasFlag(MouseButtons.Left))
{
ChartArea ca = chart.ChartAreas[0];
Axis ax = ca.AxisX;
Axis ay = ca.AxisY;
ChartArea ca = chart.ChartAreas[0];
Axis ax = ca.AxisX;
Axis ay = ca.AxisY;

HitTestResult hit = chart.HitTest(e.X, e.Y);
if (hit.Series is not null && hit.PointIndex >= 0)
curPoint = hit.Series.Points[hit.PointIndex];
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;


if (curPoint != null)
{
if (curPoint != null)
{

Series s = hit.Series;
double dx, dy, dymin;
Series s = hit.Series;
double dx, dy, dymin;

try
{
dx = ax.PixelPositionToValue(e.X);
dy = ay.PixelPositionToValue(e.Y);
try
{
dx = ax.PixelPositionToValue(e.X);
dy = ay.PixelPositionToValue(e.Y);

if (dx < 20) dx = 20;
if (dx > 100) dx = 100;
if (dx < 20) dx = 20;
if (dx > 100) dx = 100;

if (dy < 0) dy = 0;
if (dy > 100) dy = 100;
if (dy < 0) dy = 0;
if (dy > 100) dy = 100;

dymin = (dx - 65) * 1.2;
dymin = (dx - 65) * 1.2;

if (dy < dymin) dy = dymin;
if (dy < dymin) dy = dymin;

if (e.Button.HasFlag(MouseButtons.Left))
{
curPoint.XValue = dx;
curPoint.YValues[0] = dy;

labelTip.Visible = true;
labelTip.Text = Math.Round(dx) + "C, " + ChartPercToRPM((int)dy, " " + Properties.Strings.RPM);
labelTip.Top = e.Y + ((Control)sender).Top;
labelTip.Left = e.X;

}
catch
{
Debug.WriteLine(e.Y);
}

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;
}

} else
{
labelTip.Visible = false;
}

}
}

Expand Down
5 changes: 1 addition & 4 deletions app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ static class Program
public static void Main()
{

if (CultureInfo.CurrentUICulture.ToString().Contains("zh-"))
Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh");
else
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;

Debug.WriteLine(CultureInfo.CurrentUICulture);

Expand Down
Loading

0 comments on commit 6d0bb5b

Please sign in to comment.