From 0a6f8f5e655841781633a8608eba16007f26a2a0 Mon Sep 17 00:00:00 2001 From: Sunny Date: Wed, 6 Sep 2023 23:28:38 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIProcessBar:=20=E4=BF=AE=E5=A4=8D=E5=80=BC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E8=BF=87=E7=A8=8B=E4=B8=AD=E7=9A=84Int?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIProcessBar.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SunnyUI/Controls/UIProcessBar.cs b/SunnyUI/Controls/UIProcessBar.cs index 403a8c31..b45bc832 100644 --- a/SunnyUI/Controls/UIProcessBar.cs +++ b/SunnyUI/Controls/UIProcessBar.cs @@ -24,6 +24,7 @@ * 2022-03-19: V3.1.1 重构主题配色 * 2022-09-05: V3.2.3 修改最大值至少为1 * 2023-05-12: V3.3.6 重构DrawString函数 + * 2023-09-05: V3.4.2 修复值计算过程中的Int越界问题 ******************************************************************************/ using System; @@ -141,9 +142,9 @@ namespace Sunny.UI string processText; if (Direction == UILine.LineDirection.Horizontal) - processSize = posValue * Width * 1.0f / Maximum; + processSize = posValue * 1.0f / Maximum * Width; else - processSize = posValue * Height * 1.0f / Maximum; + processSize = posValue * 1.0f / Maximum * Height; if (ShowPercent) processText = (posValue * 100.0 / maximum).ToString("F" + decimalCount) + "%";