mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
fix container subnodes render
This commit is contained in:
parent
8ddfa48339
commit
897d22b50e
1 changed files with 3 additions and 2 deletions
|
|
@ -87,14 +87,15 @@ void Container::draw(const DrawContext* pctx, Assets* assets) {
|
||||||
|
|
||||||
auto batch = pctx->getBatch2D();
|
auto batch = pctx->getBatch2D();
|
||||||
batch->texture(nullptr);
|
batch->texture(nullptr);
|
||||||
batch->flush();
|
if (!nodes.empty()) {
|
||||||
{
|
batch->flush();
|
||||||
DrawContext ctx = pctx->sub();
|
DrawContext ctx = pctx->sub();
|
||||||
ctx.setScissors(glm::vec4(pos.x, pos.y, size.x, size.y));
|
ctx.setScissors(glm::vec4(pos.x, pos.y, size.x, size.y));
|
||||||
for (const auto& node : nodes) {
|
for (const auto& node : nodes) {
|
||||||
if (node->isVisible())
|
if (node->isVisible())
|
||||||
node->draw(pctx, assets);
|
node->draw(pctx, assets);
|
||||||
}
|
}
|
||||||
|
batch->flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue