Allow maxLogoCount to be set to 0 for legacy themes.

This commit is contained in:
Leon Styhre 2022-08-14 23:04:25 +02:00
parent 0dfdf1c20c
commit 85ce3ef7f6

View file

@ -915,9 +915,10 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
}
if (elem->has("maxLogoCount")) {
// For legacy themes we allow a maxLogoCount (maxItemCount) of 0.
if (theme->isLegacyTheme())
mMaxItemCount =
std::ceil(glm::clamp(elem->get<float>("maxLogoCount"), 0.5f, 30.0f));
std::ceil(glm::clamp(elem->get<float>("maxLogoCount"), 0.0f, 30.0f));
else
mMaxItemCount = glm::clamp(elem->get<float>("maxLogoCount"), 0.5f, 30.0f);
}