mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed an issue where the slider knob was sometimes not correctly positioned horizontally
This commit is contained in:
parent
d6f4c40a38
commit
b43e466175
|
@ -165,11 +165,6 @@ void SliderComponent::onValueChanged()
|
||||||
|
|
||||||
mKnob.setResize(0.0f, std::round(mSize.y * 0.7f));
|
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())
|
if (mRenderer->getScreenWidth() > mRenderer->getScreenHeight())
|
||||||
mBarHeight = std::round(2.0f * mRenderer->getScreenHeightModifier());
|
mBarHeight = std::round(2.0f * mRenderer->getScreenHeightModifier());
|
||||||
else
|
else
|
||||||
|
@ -185,6 +180,11 @@ void SliderComponent::onValueChanged()
|
||||||
setSize(getSize().x, getSize().y - 1.0f);
|
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.
|
// Likewise for the bar.
|
||||||
if (static_cast<int>(mSize.y) % 2 != static_cast<int>(mBarHeight) % 2) {
|
if (static_cast<int>(mSize.y) % 2 != static_cast<int>(mBarHeight) % 2) {
|
||||||
if (mBarHeight > 1.0f && mSize.y / mBarHeight < 5.0f)
|
if (mBarHeight > 1.0f && mSize.y / mBarHeight < 5.0f)
|
||||||
|
|
Loading…
Reference in a new issue