Skip to content

Commit

Permalink
Fix error message caused by adding new parameter to background (#8922)
Browse files Browse the repository at this point in the history
Adds background9[] element to keep backwards compatibility in formspec prepends.
  • Loading branch information
rubenwardy authored and SmallJoker committed Sep 29, 2019
1 parent 16865a5 commit 07bdd60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/lua_api.txt
Expand Up @@ -2114,7 +2114,7 @@ Elements
* If `auto_clip` is `true`, the background is clipped to the formspec size
(`x` and `y` are used as offset values, `w` and `h` are ignored)

### `background[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`
### `background9[<X>,<Y>;<W>,<H>;<texture name>;<auto_clip>;<middle>]`

* 9-sliced background. See https://en.wikipedia.org/wiki/9-slice_scaling
* Middle is a rect which defines the middle of the 9-slice.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/guiFormSpecMenu.cpp
Expand Up @@ -2231,8 +2231,8 @@ void GUIFormSpecMenu::parseElement(parserData* data, const std::string &element)
return;
}

if (type == "background") {
parseBackground(data,description);
if (type == "background" || type == "background9") {
parseBackground(data, description);
return;
}

Expand Down

0 comments on commit 07bdd60

Please sign in to comment.