Skip to content

Commit 5a26e46

Browse files
authored
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
1 parent 3cc25b7 commit 5a26e46

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/gui/guiFormSpecMenu.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -668,15 +668,16 @@ void GUIFormSpecMenu::parseBackground(parserData* data, const std::string &eleme
668668
geom.X = stof(v_geom[0]) * spacing.X;
669669
geom.Y = stof(v_geom[1]) * spacing.Y;
670670

671-
if (!data->explicit_size)
672-
warningstream<<"invalid use of background without a size[] element"<<std::endl;
673-
674671
bool clip = false;
675672
if (parts.size() == 4 && is_yes(parts[3])) {
676673
pos.X = stoi(v_pos[0]); //acts as offset
677674
pos.Y = stoi(v_pos[1]); //acts as offset
678675
clip = true;
679676
}
677+
678+
if (!data->explicit_size && !clip)
679+
warningstream << "invalid use of unclipped background without a size[] element" << std::endl;
680+
680681
m_backgrounds.emplace_back(name, pos, geom, clip);
681682

682683
return;

0 commit comments

Comments
 (0)