1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Avoid drawing clipped out formspec elements (#10095)

This commit is contained in:
EvidenceB 2020-08-23 22:50:14 +02:00 committed by GitHub
parent 3c2890692b
commit 287f3fb2e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

View file

@ -56,6 +56,18 @@ bool GUIScrollContainer::OnEvent(const SEvent &event)
return IGUIElement::OnEvent(event);
}
void GUIScrollContainer::draw()
{
if (isVisible()) {
core::list<IGUIElement *>::Iterator it = Children.begin();
for (; it != Children.end(); ++it)
if ((*it)->isNotClipped() ||
AbsoluteClippingRect.isRectCollided(
(*it)->getAbsolutePosition()))
(*it)->draw();
}
}
void GUIScrollContainer::updateScrolling()
{
s32 pos = m_scrollbar->getPos();