From 3eb957279fefbce4ccd30090dcdc905913225389 Mon Sep 17 00:00:00 2001 From: Sunny Date: Tue, 20 Feb 2024 21:42:57 +0800 Subject: [PATCH] =?UTF-8?q?*=20UISymbolPanel:=20=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Font/UISymbolPanel.cs | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/SunnyUI/Font/UISymbolPanel.cs b/SunnyUI/Font/UISymbolPanel.cs index 190fc0d2..bd71e61d 100644 --- a/SunnyUI/Font/UISymbolPanel.cs +++ b/SunnyUI/Font/UISymbolPanel.cs @@ -1,4 +1,26 @@ -using System; +/****************************************************************************** + * SunnyUI 开源控件库、工具类库、扩展类库、多页面开发框架。 + * CopyRight (C) 2012-2023 ShenYongHua(沈永华). + * QQ群:56829229 QQ:17612584 EMail:SunnyUI@QQ.Com + * + * Blog: https://www.cnblogs.com/yhuse + * Gitee: https://gitee.com/yhuse/SunnyUI + * GitHub: https://github.com/yhuse/SunnyUI + * + * SunnyUI.dll can be used for free under the GPL-3.0 license. + * If you use this code, please keep this note. + * 如果您使用此代码,请保留此说明。 + ****************************************************************************** + * 文件名称: UISymbolPanel.cs + * 文件说明: 字体图标编辑器面板 + * 当前版本: V3.1 + * 创建日期: 2020-01-01 + * + * 2023-11-28: V3.6.1 增加文件说明 + * 2024-02-20: V3.6.3 设置默认尺寸 +******************************************************************************/ + +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; @@ -15,11 +37,15 @@ namespace Sunny.UI public UISymbolPanel() { SetStyleFlags(); + Width = 768; + Height = 128; } public UISymbolPanel(Type fonttype, UISymbolType symbolType, int columnCount = 24) { SetStyleFlags(); + Width = 768; + Height = 128; LoadFont(fonttype, symbolType, columnCount); } @@ -117,8 +143,8 @@ namespace Sunny.UI int width = symbolSize * column; int height = symbolSize * row; - if (Width != width) Width = width; - if (Height != height) Height = height; + if (width > 0 && Width != width) Width = width; + if (height > 0 && Height != height) Height = height; } protected override void OnPaint(PaintEventArgs e)