aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/guiFormSpecMenu.cpp10
-rw-r--r--src/gui/guiScrollContainer.cpp12
-rw-r--r--src/gui/guiScrollContainer.h2
3 files changed, 21 insertions, 3 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 76441c645..7e3ad3b15 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -3483,10 +3483,14 @@ void GUIFormSpecMenu::drawMenu()
e->setVisible(true);
/*
- Call base class
- (This is where all the drawing happens.)
+ This is where all the drawing happens.
*/
- gui::IGUIElement::draw();
+ core::list<IGUIElement*>::Iterator it = Children.begin();
+ for (; it != Children.end(); ++it)
+ if ((*it)->isNotClipped() ||
+ AbsoluteClippingRect.isRectCollided(
+ (*it)->getAbsolutePosition()))
+ (*it)->draw();
for (gui::IGUIElement *e : m_clickthrough_elements)
e->setVisible(false);
diff --git a/src/gui/guiScrollContainer.cpp b/src/gui/guiScrollContainer.cpp
index 88cdc7057..0fe4c41bd 100644
--- a/src/gui/guiScrollContainer.cpp
+++ b/src/gui/guiScrollContainer.cpp
@@ -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();
diff --git a/src/gui/guiScrollContainer.h b/src/gui/guiScrollContainer.h
index a0306291e..9e3ec6e93 100644
--- a/src/gui/guiScrollContainer.h
+++ b/src/gui/guiScrollContainer.h
@@ -32,6 +32,8 @@ public:
virtual bool OnEvent(const SEvent &event) override;
+ virtual void draw() override;
+
inline void onScrollEvent(gui::IGUIElement *caller)
{
if (caller == m_scrollbar)