From 4a390fb8e090224eb3443a4b9928d9c3e43a041a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Thu, 10 Aug 2023 19:22:46 +0200 Subject: [PATCH] Added a 'containerScrollGap' property to the text element --- es-core/src/ThemeData.cpp | 1 + es-core/src/components/TextComponent.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index 3894fa2b0..4bf6ae63d 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -397,6 +397,7 @@ std::map> {"containerScrollSpeed", FLOAT}, {"containerStartDelay", FLOAT}, {"containerResetDelay", FLOAT}, + {"containerScrollGap", FLOAT}, {"fontPath", PATH}, {"fontSize", FLOAT}, {"horizontalAlignment", STRING}, diff --git a/es-core/src/components/TextComponent.cpp b/es-core/src/components/TextComponent.cpp index 8d21a3e09..7c46fcbe0 100644 --- a/es-core/src/components/TextComponent.cpp +++ b/es-core/src/components/TextComponent.cpp @@ -595,6 +595,9 @@ void TextComponent::applyTheme(const std::shared_ptr& theme, mScrollDelay = glm::clamp(elem->get("containerStartDelay"), 0.0f, 10.0f) * 1000.0f; } + if (elem->has("containerScrollGap")) { + mScrollGap = glm::clamp(elem->get("containerScrollGap"), 0.1f, 5.0f); + } mHorizontalScrolling = true; } else if (containerType != "vertical") {