diff options
author | Hugues Ross <hugues.ross@gmail.com> | 2020-01-16 13:41:07 -0500 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-01-16 18:41:07 +0000 |
commit | 680aaa1bd55fd4f0162ba31ca47d7e5b3563f2a1 (patch) | |
tree | 9bf016488eecfb804585d2ac10f2c5bb3178d466 /src/gui | |
parent | cea4fd2b27bd266a3dcb8f9ddf9b434ba00c60ad (diff) | |
download | minetest-680aaa1bd55fd4f0162ba31ca47d7e5b3563f2a1.tar.gz minetest-680aaa1bd55fd4f0162ba31ca47d7e5b3563f2a1.tar.bz2 minetest-680aaa1bd55fd4f0162ba31ca47d7e5b3563f2a1.zip |
Make clipping of formspec elements more consistent (#9262)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/guiFormSpecMenu.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp index 3c9e55d06..5ddfbc6d5 100644 --- a/src/gui/guiFormSpecMenu.cpp +++ b/src/gui/guiFormSpecMenu.cpp @@ -744,7 +744,8 @@ void GUIFormSpecMenu::parseImage(parserData* data, const std::string &element) gui::IGUIImage *e = Environment->addImage(rect, this, spec.fid, 0, true); e->setImage(texture); e->setScaleImage(true); - e->setNotClipped(true); + auto style = getStyleForElement("image", spec.fname); + e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3)); m_fields.push_back(spec); return; @@ -776,7 +777,8 @@ void GUIFormSpecMenu::parseImage(parserData* data, const std::string &element) ); gui::IGUIImage *e = Environment->addImage(texture, pos, true, this, spec.fid, 0); - e->setNotClipped(true); + auto style = getStyleForElement("image", spec.fname); + e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3)); m_fields.push_back(spec); return; @@ -824,6 +826,8 @@ void GUIFormSpecMenu::parseItemImage(parserData* data, const std::string &elemen GUIItemImage *e = new GUIItemImage(Environment, this, spec.fid, core::rect<s32>(pos, pos + geom), name, m_font, m_client); + auto style = getStyleForElement("item_image", spec.fname); + e->setNotClipped(style.getBool(StyleSpec::NOCLIP, false)); e->drop(); m_fields.push_back(spec); @@ -2110,7 +2114,8 @@ void GUIFormSpecMenu::parseBox(parserData* data, const std::string &element) GUIBox *e = new GUIBox(Environment, this, spec.fid, rect, tmp_color); - e->setNotClipped(true); + auto style = getStyleForElement("box", spec.fname); + e->setNotClipped(style.getBool(StyleSpec::NOCLIP, m_formspec_version < 3)); e->drop(); |