* UFontImage: MaterialIcons字体图标调大3个像素

This commit is contained in:
Sunny 2023-10-25 15:10:47 +08:00
parent 8e3f95d961
commit 49cda26702
2 changed files with 9 additions and 3 deletions

View File

@ -23,6 +23,7 @@
* 2021-06-15: V3.3.5 FontAwesomeV6的字体图标 * 2021-06-15: V3.3.5 FontAwesomeV6的字体图标
* 2023-05-16: V3.3.6 DrawFontImage函数 * 2023-05-16: V3.3.6 DrawFontImage函数
* 2022-05-17: V3.3.7 * 2022-05-17: V3.3.7
* 2023-10-25: V3.5.1 MaterialIcons字体图标调大3个像素
******************************************************************************/ ******************************************************************************/
using System.Collections.Generic; using System.Collections.Generic;
@ -197,7 +198,7 @@ namespace Sunny.UI
case UISymbolType.FontAwesomeV6Solid: case UISymbolType.FontAwesomeV6Solid:
return Fonts[UISymbolType.FontAwesomeV6Solid].GetFont(symbolValue, imageSize); return Fonts[UISymbolType.FontAwesomeV6Solid].GetFont(symbolValue, imageSize);
case UISymbolType.MaterialIcons: case UISymbolType.MaterialIcons:
return Fonts[UISymbolType.MaterialIcons].GetFont(symbolValue, imageSize); return Fonts[UISymbolType.MaterialIcons].GetFont(symbolValue, imageSize, 3);
default: default:
return null; return null;
} }

View File

@ -89,10 +89,15 @@ namespace Sunny.UI
/// <param name="iconText">图标</param> /// <param name="iconText">图标</param>
/// <param name="imageSize">图标大小</param> /// <param name="imageSize">图标大小</param>
/// <returns>字体</returns> /// <returns>字体</returns>
public Font GetFont(int iconText, int imageSize) public Font GetFont(int iconText, int imageSize, int offset = 0)
{ {
int item = GetFontSize(iconText, imageSize); int item = GetFontSize(iconText, imageSize);
return Fonts.ContainsKey(item) ? Fonts[item] : null; if (Fonts.ContainsKey(item + offset))
return Fonts[item + offset];
else if (Fonts.ContainsKey(item))
return Fonts[item];
else
return null;
} }
/// <summary> /// <summary>