summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDS <vorunbekannt75@web.de>2019-09-15 18:14:31 +0200
committerrubenwardy <rw@rubenwardy.com>2019-09-15 17:14:31 +0100
commit1db3d252cff9e8d61fecf1052d7497813851da51 (patch)
treec06529aa533410a1ba5a9971cee028eaefc4e321 /src
parent1ea9bfc6f75316e8de852c3a529541b5c800b367 (diff)
downloadminetest-1db3d252cff9e8d61fecf1052d7497813851da51.tar.gz
minetest-1db3d252cff9e8d61fecf1052d7497813851da51.tar.bz2
minetest-1db3d252cff9e8d61fecf1052d7497813851da51.zip
Fix the bgcolor formspec element (#8716)
Diffstat (limited to 'src')
-rw-r--r--src/gui/guiFormSpecMenu.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 53b8ae848..e8a7f546e 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -1881,17 +1881,17 @@ void GUIFormSpecMenu::parseBox(parserData* data, const std::string &element)
errorstream<< "Invalid Box element(" << parts.size() << "): '" << element << "'" << std::endl;
}
-void GUIFormSpecMenu::parseBackgroundColor(parserData* data, const std::string &element)
+void GUIFormSpecMenu::parseBackgroundColor(parserData *data, const std::string &element)
{
std::vector<std::string> parts = split(element,';');
if (((parts.size() == 1) || (parts.size() == 2)) ||
((parts.size() > 2) && (m_formspec_version > FORMSPEC_API_VERSION))) {
- parseColorString(parts[0], m_bgcolor, false);
-
- if (parts.size() == 2) {
- std::string fullscreen = parts[1];
- m_bgfullscreen = is_yes(fullscreen);
+ if (parts.size() == 1) {
+ parseColorString(parts[0], m_bgcolor, false);
+ } else if (parts.size() == 2) {
+ parseColorString(parts[0], m_fullscreen_bgcolor, false);
+ m_bgfullscreen = is_yes(parts[1]);
}
return;
@@ -2921,8 +2921,7 @@ void GUIFormSpecMenu::drawMenu()
if (m_bgfullscreen)
driver->draw2DRectangle(m_fullscreen_bgcolor, allbg, &allbg);
- else
- driver->draw2DRectangle(m_bgcolor, AbsoluteRect, &AbsoluteClippingRect);
+ driver->draw2DRectangle(m_bgcolor, AbsoluteRect, &AbsoluteClippingRect);
m_tooltip_element->setVisible(false);