mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 01:25:38 +00:00
Added a check for whether a text element has a width defined when the container property is set
This commit is contained in:
parent
ce3d50d2b3
commit
b9f8d4cfdd
|
@ -641,7 +641,13 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem->has("container") && elem->get<bool>("container")) {
|
if (elem->has("container") && elem->get<bool>("container")) {
|
||||||
if (elem->has("containerType")) {
|
if (!elem->has("size") || (elem->has("size") && elem->get<glm::vec2>("size").x == 0.0f)) {
|
||||||
|
LOG(LogError) << "TextComponent: Invalid theme configuration, property "
|
||||||
|
"\"container\" for element \""
|
||||||
|
<< element.substr(5)
|
||||||
|
<< "\" can't be used as a horizontal size has not been defined";
|
||||||
|
}
|
||||||
|
else if (elem->has("containerType")) {
|
||||||
const std::string& containerType {elem->get<std::string>("containerType")};
|
const std::string& containerType {elem->get<std::string>("containerType")};
|
||||||
if (containerType == "horizontal") {
|
if (containerType == "horizontal") {
|
||||||
if (elem->has("containerScrollSpeed")) {
|
if (elem->has("containerScrollSpeed")) {
|
||||||
|
|
Loading…
Reference in a new issue