diff --git a/es-core/src/components/SliderComponent.cpp b/es-core/src/components/SliderComponent.cpp index 181bf7bd8..00de12644 100644 --- a/es-core/src/components/SliderComponent.cpp +++ b/es-core/src/components/SliderComponent.cpp @@ -165,11 +165,6 @@ void SliderComponent::onValueChanged() mKnob.setResize(0.0f, std::round(mSize.y * 0.7f)); - float barLength { - mSize.x - mKnob.getSize().x - - (mTextCache ? mTextCache->metrics.size.x + (4.0f * mRenderer->getScreenWidthModifier()) : - 0.0f)}; - if (mRenderer->getScreenWidth() > mRenderer->getScreenHeight()) mBarHeight = std::round(2.0f * mRenderer->getScreenHeightModifier()); else @@ -185,6 +180,11 @@ void SliderComponent::onValueChanged() setSize(getSize().x, getSize().y - 1.0f); } + float barLength { + mSize.x - mKnob.getSize().x - + (mTextCache ? mTextCache->metrics.size.x + (4.0f * mRenderer->getScreenWidthModifier()) : + 0.0f)}; + // Likewise for the bar. if (static_cast(mSize.y) % 2 != static_cast(mBarHeight) % 2) { if (mBarHeight > 1.0f && mSize.y / mBarHeight < 5.0f)