feat: add a new awesome feature

This commit is contained in:
2025-11-04 16:48:53 +08:00
parent 8dee285de8
commit 7b087e296a
22 changed files with 210 additions and 58 deletions

View File

@@ -77,9 +77,9 @@ void Control::restoreStyle()
setfillstyle(BS_SOLID);//恢复填充
}
void Control::requestRepaint()
void Control::requestRepaint(Control* parent)
{
if (parent) parent->requestRepaint(); // 向上冒泡
if (parent) parent->requestRepaint(parent); // 向上冒泡
else onRequestRepaintAsRoot(); // 到根控件/窗口兜底
}
@@ -93,9 +93,9 @@ void Control::onRequestRepaintAsRoot()
void Control::saveBackground(int x, int y, int w, int h)
{
if (w <= 0 || h <= 0) return;
saveBkX = x; saveBkY = y; saveWidth = w; saveHeight = h;
if (saveBkImage)
{
//尺寸变了才重建,避免反复 new/delete