Implement VCanvas and Update TextElem

- Text now requires a font and is able to take an individual scale
- Container requires &ref for Elements to make sure they always exist
- SetViewport now sets the canvas as well
- SetBaseViewport Sets the Virtual Canvas Size
- Layout Now requires a Drawlist reference in Render function
- main.cpp: updated the template
This commit is contained in:
2026-04-03 12:43:49 +02:00
parent 1cf3b6f8e6
commit a776addf11
8 changed files with 97 additions and 60 deletions
+4 -2
View File
@@ -13,8 +13,10 @@ PD_API bool ElementBase::RevisionUpdate(PD::u32 req) {
}
PD_API void ElementBase::Update() {
if (!pParent) pRenderspace = PD::fvec4(pPos, pPos + pSize);
pRenderspace = PD::fvec4(pParent->GetTopLeft() + pPos,
pParent->GetTopLeft() + pPos + pSize);
pRenderspace = pParent->GetCanvas().VTranslateObject(
pParent->GetTopLeft() + pPos, pSize, pAlignment);
/*pRenderspace = PD::fvec4(pParent->GetTopLeft() + pPos,
pParent->GetTopLeft() + pPos + pSize);*/
}
} // namespace Ultra
} // namespace PD