Make UI7::IO::CurrentViewPort a Reference (finally)

This commit is contained in:
2026-03-18 21:33:35 +01:00
parent 3d8b57ead6
commit 0501a4f87c
6 changed files with 18 additions and 15 deletions

View File

@@ -29,7 +29,8 @@ PD_API void Label::Draw() {
// Assert(io.get() && list.get(), "Did you run Container::Init correctly?");
// io->Ren->OnScreen(screen);
list->DrawTextEx(FinalPos(), label, io->Theme->Get(UI7Color_Text),
LiTextFlags_NoOOS, PD::fvec2(0, io->CurrentViewPort.w));
LiTextFlags_NoOOS,
PD::fvec2(0, io->CurrentViewPort->pSize.w));
}
PD_API void Label::Update() {
@@ -39,11 +40,11 @@ PD_API void Label::Update() {
* Needs a max size (to support sligning dynaically by the window size)
*/
if (io->WrapLabels) {
this->label =
io->Font->pWrapText(this->label, io->FontScale,
PD::fvec2(io->CurrentViewPort.z - FinalPos().x * 4,
io->CurrentViewPort.w),
this->tdim);
this->label = io->Font->pWrapText(
this->label, io->FontScale,
PD::fvec2(io->CurrentViewPort->pSize.z - FinalPos().x * 4,
io->CurrentViewPort->pSize.w),
this->tdim);
SetSize(tdim);
}
}