reset layers and give menus a base layer to gather perfect ordered rendering
This commit is contained in:
@@ -62,6 +62,7 @@ PD_API void ColorEdit::Draw() {
|
||||
l->PathRect(thiz->GetPos(), thiz->GetPos() + thiz->GetSize(),
|
||||
io->FrameRounding);
|
||||
l->PathFill(io->Theme.Get(UI7Color_FrameBackground));
|
||||
l->SetLayer(0);
|
||||
});
|
||||
layout->AddObjectEx(r, UI7LytAdd_Front | UI7LytAdd_NoCursorUpdate |
|
||||
UI7LytAdd_NoScrollHandle);
|
||||
@@ -87,7 +88,9 @@ PD_API void ColorEdit::Draw() {
|
||||
layout->Slider<u8>("B", ((u8*)color_ref) + 2);
|
||||
layout->Slider<u8>("A", ((u8*)color_ref) + 3);
|
||||
layout->Update();
|
||||
list->SetLayer(50);
|
||||
list->Merge(layout->GetDrawList());
|
||||
list->SetLayer(0);
|
||||
// io->RegisterDrawList(GetID(), layout->GetDrawList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ PD_API void Menu::DrawBaseLayout() {
|
||||
l->PathAdd(self->FinalPos() + self->GetSize());
|
||||
l->PathAdd(self->FinalPos() + self->GetSize() - fvec2(20, 0));
|
||||
l->PathFill(io->Theme.Get(UI7Color_Button));
|
||||
l->SetLayer(0);
|
||||
});
|
||||
r->SetSize(
|
||||
fvec2(pLayout.GetSize().x, pLayout.GetSize().y - TitleBarHeight));
|
||||
@@ -268,6 +269,7 @@ PD_API void Menu::DrawBaseLayout() {
|
||||
(io->FramePadding.x * 2)),
|
||||
2),
|
||||
pID.GetName().c_str(), io->Theme.Get(UI7Color_Text));
|
||||
l->SetLayer(0);
|
||||
});
|
||||
r->SetSize(fvec2(pLayout.GetSize().x, TitleBarHeight));
|
||||
r->SetPos(0);
|
||||
@@ -290,6 +292,7 @@ PD_API void Menu::DrawBaseLayout() {
|
||||
self->FinalPos() +
|
||||
fvec2(pIsOpen ? self->GetSize().x * 0.5 : 0, self->GetSize().y),
|
||||
io->Theme.Get(UI7Color_FrameBackground));
|
||||
l->SetLayer(0);
|
||||
});
|
||||
r->SetSize(TitleBarHeight - pIO.FramePadding.y * 2);
|
||||
r->SetPos(pIO.FramePadding);
|
||||
|
||||
@@ -143,8 +143,11 @@ PD_API void Context::Update() {
|
||||
pMenus[it]->Update(); /** Render */
|
||||
this->pIO.InputHandler.CurrentMenu = 0;
|
||||
}
|
||||
int base_layer = 0;
|
||||
for (int i = (int)FinalList.size() - 1; i >= 0; i--) {
|
||||
pIO.FDL.SetLayer(base_layer);
|
||||
pIO.FDL.Merge(pMenus[FinalList[i]]->pLayout.GetDrawList());
|
||||
base_layer += 100;
|
||||
}
|
||||
pCurrentMenus.clear();
|
||||
pIO.Update();
|
||||
|
||||
Reference in New Issue
Block a user