mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Fixed a small alignment issue in SliderComponent.
This commit is contained in:
parent
99d0f17e6b
commit
c4fb3eafbe
|
@ -166,10 +166,14 @@ void SliderComponent::onValueChanged()
|
|||
barHeight = 1;
|
||||
|
||||
// Resize the knob one pixel if necessary to keep the bar centered.
|
||||
if (barHeight % 2 == 0 && static_cast<int>(mKnob.getSize().y) % 2 != 0)
|
||||
if (barHeight % 2 == 0 && static_cast<int>(mKnob.getSize().y) % 2 != 0) {
|
||||
mKnob.setResize(mKnob.getSize().x - 1.0f, mKnob.getSize().y - 1.0f);
|
||||
else if (barHeight == 1 && static_cast<int>(mKnob.getSize().y) % 2 == 0)
|
||||
setSize(getSize().x, getSize().y - 1.0f);
|
||||
}
|
||||
else if (barHeight == 1 && static_cast<int>(mKnob.getSize().y) % 2 == 0) {
|
||||
mKnob.setResize(mKnob.getSize().x - 1.0f, mKnob.getSize().y - 1);
|
||||
setSize(getSize().x, getSize().y - 1.0f);
|
||||
}
|
||||
|
||||
mBarHeight = static_cast<float>(barHeight);
|
||||
|
||||
|
|
Loading…
Reference in a new issue