.cosmetics

This commit is contained in:
Mirek Fidler 2025-01-31 09:35:55 +01:00
parent ccbd03f376
commit dce53b4989
2 changed files with 5 additions and 6 deletions

View file

@ -13,7 +13,7 @@ struct AnimateCtrlGeometry : TopWindow {
CenterScreen().SetRect(0,0, 400, 200);
for(int row = 0, i = 0; row < 2; row++) {
for(int row = 0; row < 2; row++) {
for(int col = 0; col < 4; col++) {
ColorPusher& bt = pushers.Add();
bt <<= Color(Random(256), Random(256), Random(256));
@ -25,7 +25,6 @@ struct AnimateCtrlGeometry : TopWindow {
}
SetTimeCallback(1000, [&]{ Animate(ctrls, targets, 300); });
}
};

View file

@ -72,13 +72,13 @@ void Animate(Event<double> update, int duration)
Ctrl::GuiSleep(0);
}
update(1);
}
}
void Animate(Vector<Ptr<Ctrl>>& ctrls, const Vector<Rect>& targets, int duration)
{
Vector<Rect> data;
for(const Ptr<Ctrl>& c : ctrls)
data.Add(Nvl(c->GetRect(), {0, 0, 0, 0}));
Vector<Rect> data;
for(const Ptr<Ctrl>& c : ctrls)
data.Add(Nvl(c->GetRect(), {0, 0, 0, 0}));
Animate(data, targets, [&] {
for(int i = 0; i < ctrls.GetCount(); i++)