feat: add a new awesome feature

This commit is contained in:
2025-11-08 01:06:37 +08:00
parent cc08187ced
commit 5420bfd644
16 changed files with 918 additions and 421 deletions

View File

@@ -76,6 +76,9 @@ bool Canvas::handleEvent(const ExMessage& msg)
void Canvas::addControl(std::unique_ptr<Control> control)
{
//坐标转化
control->setX(control->getLocalX() + this->x);
control->setY(control->getLocalY() + this->y);
control->setParent(this);
controls.push_back(std::move(control));
dirty = true;
@@ -166,10 +169,7 @@ void Canvas::requestRepaint(Control* parent)
{
for (auto& control : controls)
if (control->isDirty() && control->IsVisible())
{
control->draw();
break;
}
}
else
onRequestRepaintAsRoot();