From f0dd72add999ac1e92f178a10e326be2de607c00 Mon Sep 17 00:00:00 2001 From: queader <84995098+queader@users.noreply.github.com> Date: Mon, 14 Feb 2022 19:57:14 +0100 Subject: [PATCH] Fix percentage tray icon when using high dpi display (#666) Co-authored-by: queader --- LibreHardwareMonitor/UI/SensorNotifyIcon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibreHardwareMonitor/UI/SensorNotifyIcon.cs b/LibreHardwareMonitor/UI/SensorNotifyIcon.cs index 7e37319..7c101b7 100644 --- a/LibreHardwareMonitor/UI/SensorNotifyIcon.cs +++ b/LibreHardwareMonitor/UI/SensorNotifyIcon.cs @@ -216,7 +216,7 @@ namespace LibreHardwareMonitor.UI } _graphics.FillRectangle(_darkBrush, 0.5f, -0.5f, _bitmap.Width - 2, _bitmap.Height); float value = Sensor.Value.GetValueOrDefault(); - float y = 0.16f * (100 - value); + float y = (float)(_bitmap.Height * 0.01f) * (100 - value); _graphics.FillRectangle(_brush, 0.5f, -0.5f + y, _bitmap.Width - 2, _bitmap.Height - y); _graphics.DrawRectangle(_pen, 1, 0, _bitmap.Width - 3, _bitmap.Height - 1);