Skip to content

Commit 9e18d37

Browse files
committed
Fans + Power sizing fix #3830
1 parent d6ce379 commit 9e18d37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/Fans.cs

+7-2
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ public void FormPosition()
782782
{
783783
if (Height > Program.settingsForm.Height)
784784
{
785-
Top = Program.settingsForm.Top + Program.settingsForm.Height - Height;
785+
Top = Math.Max(0, Program.settingsForm.Top + Program.settingsForm.Height - Height);
786786
}
787787
else
788788
{
@@ -1049,7 +1049,12 @@ public void InitFans()
10491049
try
10501050
{
10511051
if (chartCount > 2)
1052-
Size = MinimumSize = new Size(Size.Width, Math.Max(MinimumSize.Height, (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100))));
1052+
{
1053+
int maxHeight = (int)(ControlHelper.GetDpiScale(this).Value * (chartCount * 200 + 100));
1054+
maxHeight = Math.Min(maxHeight, Screen.PrimaryScreen.WorkingArea.Height - 50);
1055+
Size = MinimumSize = new Size(Size.Width, Math.Max(MinimumSize.Height, maxHeight));
1056+
}
1057+
10531058
}
10541059
catch (Exception ex)
10551060
{

0 commit comments

Comments
 (0)