From cb26de8224c96c7b34835ce5f2b1308255464c59 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 13 Oct 2021 15:42:41 -0400 Subject: [PATCH] Fix an off-by-one pixel error in the mod bar (#5243) Closes #5238 --- src/surge-xt/gui/widgets/ModulatableSlider.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/surge-xt/gui/widgets/ModulatableSlider.cpp b/src/surge-xt/gui/widgets/ModulatableSlider.cpp index 59c01b3ff37..a07e481e606 100644 --- a/src/surge-xt/gui/widgets/ModulatableSlider.cpp +++ b/src/surge-xt/gui/widgets/ModulatableSlider.cpp @@ -161,11 +161,16 @@ void ModulatableSlider::paint(juce::Graphics &g) { juce::Graphics::ScopedSaveState gs(g); + float dLX = 0.f, dLY = 0.f; + if (orientation == ParamConfig::kVertical) + dLX = 1; + else + dLY = 1; g.addTransform(trayPosition); g.setColour(skin->getColor(Colors::Slider::Modulation::Positive)); - g.drawLine(handleCX, handleCY, handleMX, handleMY, 2); + g.drawLine(handleCX + dLX, handleCY + dLY, handleMX + dLX, handleMY + dLY, 2); g.setColour(skin->getColor(Colors::Slider::Modulation::Negative)); - g.drawLine(handleCX, handleCY, barNMX, barNMY, 2); + g.drawLine(handleCX + dLX, handleCY + dLY, barNMX + dLX, barNMY + dLY, 2); } // Draw the label if (drawLabel)