* UIScrollingText: 停止滚动时,可以设置默认显示位置
This commit is contained in:
parent
120dbf2151
commit
452e9e6e15
@ -21,6 +21,7 @@
|
|||||||
* 2022-03-19: V3.1.1 重构主题配色
|
* 2022-03-19: V3.1.1 重构主题配色
|
||||||
* 2023-02-23: V3.3.2 重写滚动逻辑
|
* 2023-02-23: V3.3.2 重写滚动逻辑
|
||||||
* 2023-05-12: V3.3.6 重构DrawString函数
|
* 2023-05-12: V3.3.6 重构DrawString函数
|
||||||
|
* 2024-12-02: V3.8.0 停止滚动时,可以设置默认显示位置
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -152,6 +153,8 @@ namespace Sunny.UI
|
|||||||
/// <param name="g">绘图图面</param>
|
/// <param name="g">绘图图面</param>
|
||||||
/// <param name="path">绘图路径</param>
|
/// <param name="path">绘图路径</param>
|
||||||
protected override void OnPaintFore(Graphics g, GraphicsPath path)
|
protected override void OnPaintFore(Graphics g, GraphicsPath path)
|
||||||
|
{
|
||||||
|
if (Active)
|
||||||
{
|
{
|
||||||
Size sf = TextRenderer.MeasureText(Text, Font);
|
Size sf = TextRenderer.MeasureText(Text, Font);
|
||||||
if (TextWidth != sf.Width)
|
if (TextWidth != sf.Width)
|
||||||
@ -190,6 +193,11 @@ namespace Sunny.UI
|
|||||||
g.DrawString(Text, Font, ForeColor, new Rectangle(XPos, 0, Width, Height), ContentAlignment.MiddleLeft);
|
g.DrawString(Text, Font, ForeColor, new Rectangle(XPos, 0, Width, Height), ContentAlignment.MiddleLeft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.OnPaintFore(g, path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 重载控件尺寸变更
|
/// 重载控件尺寸变更
|
||||||
|
Loading…
x
Reference in New Issue
Block a user