Added a 'containerScrollGap' property to the text element

This commit is contained in:
Leon Styhre 2023-08-10 19:22:46 +02:00
parent f463ee7d7b
commit 4a390fb8e0
2 changed files with 4 additions and 0 deletions

View file

@ -397,6 +397,7 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
{"containerScrollSpeed", FLOAT},
{"containerStartDelay", FLOAT},
{"containerResetDelay", FLOAT},
{"containerScrollGap", FLOAT},
{"fontPath", PATH},
{"fontSize", FLOAT},
{"horizontalAlignment", STRING},

View file

@ -595,6 +595,9 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
mScrollDelay =
glm::clamp(elem->get<float>("containerStartDelay"), 0.0f, 10.0f) * 1000.0f;
}
if (elem->has("containerScrollGap")) {
mScrollGap = glm::clamp(elem->get<float>("containerScrollGap"), 0.1f, 5.0f);
}
mHorizontalScrolling = true;
}
else if (containerType != "vertical") {