Rework Project Ultra

- Added container
- Made container the base of Layout
- Set Containers theirself as pParent for Elements on Push
This commit is contained in:
2026-03-29 04:28:45 +02:00
parent 4498c2c0fb
commit b5321ca1a1
10 changed files with 82 additions and 78 deletions
-11
View File
@@ -11,16 +11,5 @@ PD_API bool ElementBase::RevisionUpdate(PD::u32 req) {
return false;
}
}
PD_API void ElementBase::Update(Canvas& c) {
if (RevisionUpdate(c.GetRevision())) {
if (pParent) {
pRenderspace = c.VTranslateObject(
pParent->pRenderspace.TopLeft(),
pRenderspace.BotRight() - pRenderspace.TopLeft(), pAlignment, true);
} else {
pRenderspace = c.VTranslateObject(pPos, pSize, pAlignment);
}
}
}
} // namespace Ultra
} // namespace PD
+3 -3
View File
@@ -3,9 +3,9 @@
namespace PD {
namespace Ultra {
PD_API void Image::Draw(PD::Li::Drawlist& l) {
l.BindTexture(*pTex);
l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
l.PathFill(pColor);
// l.BindTexture(*pTex);
// l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
// l.PathFill(pColor);
}
} // namespace Ultra
} // namespace PD
+6 -4
View File
@@ -3,10 +3,12 @@
namespace PD {
namespace Ultra {
PD_API void Rect::Draw(PD::Li::Drawlist& l) {
l.PathRect(pRenderspace.TopLeft(), pRenderspace.BotRight(), pRounding);
l.PathFill(pColor);
l.DrawText(pRenderspace.BotRight(), std::to_string(pCanvasRev).c_str(),
0xff0000ff);
l.PathRect(pPos, pPos + pSize, pRounding);
if (pLined) {
l.PathStroke(pColor, pThickness, LiDrawFlags_Close);
} else {
l.PathFill(pColor);
}
}
} // namespace Ultra
} // namespace PD
+1 -1
View File
@@ -3,7 +3,7 @@
namespace PD {
namespace Ultra {
PD_API void Text::Draw(PD::Li::Drawlist& l) {
l.DrawText(pRenderspace.TopLeft(), pText.c_str(), pColor);
l.DrawText(pPos, pText.c_str(), pColor);
}
} // namespace Ultra
} // namespace PD