From 5cc970b9bc3e27dd736af9ce2011c836fb65bb62 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 28 Aug 2023 22:19:08 +0800 Subject: [PATCH] =?UTF-8?q?*=20UILight:=20=E6=81=A2=E5=A4=8D=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E7=9F=A9=E5=BD=A2=E8=AE=BE=E8=AE=A1=E6=97=B6=E5=9C=86?= =?UTF-8?q?=E5=BD=A2=E7=81=AF=E5=85=89=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UILight.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SunnyUI/Controls/UILight.cs b/SunnyUI/Controls/UILight.cs index 746e1945..0bb21af1 100644 --- a/SunnyUI/Controls/UILight.cs +++ b/SunnyUI/Controls/UILight.cs @@ -21,6 +21,7 @@ * 2021-08-07: V3.0.5 默认不显示灯光亮线 * 2022-05-15: V3.1.8 增加文字显示 * 2023-05-12: V3.3.6 重构DrawString函数 + * 2023-08-28: V3.4.2 恢复全局矩形设计时圆形灯光效果 ******************************************************************************/ using System; @@ -186,7 +187,8 @@ namespace Sunny.UI if (ShowCenterColor) { Color[] surroundColor = new Color[] { color }; - PathGradientBrush gradientBrush = new PathGradientBrush(path); + using GraphicsPath path1 = ClientRectangle.CreateTrueRoundedRectanglePath(Height); + PathGradientBrush gradientBrush = new PathGradientBrush(path1); gradientBrush.CenterPoint = new PointF(ShowSize / 2.0f, ShowSize / 2.0f); gradientBrush.CenterColor = cColor; gradientBrush.SurroundColors = surroundColor;