mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Formspec: do not draw button backgrounds if border=false
This commit is contained in:
parent
535d757563
commit
ebef65e905
2 changed files with 15 additions and 0 deletions
|
@ -24,6 +24,18 @@ GUIButtonImage::GUIButtonImage(gui::IGUIEnvironment *environment,
|
|||
sendToBack(m_image.get());
|
||||
}
|
||||
|
||||
void GUIButtonImage::draw()
|
||||
{
|
||||
if (isDrawingBorder()) {
|
||||
// `GUIButton` also allows drawing different textures depending on
|
||||
// `EGUI_BUTTON_STATE` --> Skip everything if the border is disabled (else case).
|
||||
GUIButton::draw();
|
||||
} else {
|
||||
IGUIElement::draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GUIButtonImage::setForegroundImage(irr_ptr<video::ITexture> image,
|
||||
const core::rect<s32> &middle)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,9 @@ public:
|
|||
s32 id, core::rect<s32> rectangle, ISimpleTextureSource *tsrc,
|
||||
bool noclip = false);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw() override;
|
||||
|
||||
void setForegroundImage(irr_ptr<video::ITexture> image = nullptr,
|
||||
const core::rect<s32> &middle = core::rect<s32>());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue