aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-08-20 13:56:16 +0100
committerGitHub <noreply@github.com>2018-08-20 13:56:16 +0100
commit5a26e46aaa38cccb2b38cfc784364f1f265cec9b (patch)
tree631472ad4c1524f713bade12ad4a9c2e86508a50 /src
parent3cc25b700ac07db8670becb7dcab33cac75b59f3 (diff)
downloadminetest-5a26e46aaa38cccb2b38cfc784364f1f265cec9b.tar.gz
minetest-5a26e46aaa38cccb2b38cfc784364f1f265cec9b.tar.bz2
minetest-5a26e46aaa38cccb2b38cfc784364f1f265cec9b.zip
Formspecs: Fix invalid background warning
Clipped backgrounds are still valid with no size[] tag, as they will apply themselves correctly to any size Fixes #7197
Diffstat (limited to 'src')
-rw-r--r--src/gui/guiFormSpecMenu.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp
index 948ee4030..ed94b82de 100644
--- a/src/gui/guiFormSpecMenu.cpp
+++ b/src/gui/guiFormSpecMenu.cpp
@@ -668,15 +668,16 @@ void GUIFormSpecMenu::parseBackground(parserData* data, const std::string &eleme
geom.X = stof(v_geom[0]) * spacing.X;
geom.Y = stof(v_geom[1]) * spacing.Y;
- if (!data->explicit_size)
- warningstream<<"invalid use of background without a size[] element"<<std::endl;
-
bool clip = false;
if (parts.size() == 4 && is_yes(parts[3])) {
pos.X = stoi(v_pos[0]); //acts as offset
pos.Y = stoi(v_pos[1]); //acts as offset
clip = true;
}
+
+ if (!data->explicit_size && !clip)
+ warningstream << "invalid use of unclipped background without a size[] element" << std::endl;
+
m_backgrounds.emplace_back(name, pos, geom, clip);
return;