From 6f6bb3e725f0f28f68a0f7d0a16b06fd85f0a07f Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Sat, 6 Jan 2024 17:46:15 +0100 Subject: [PATCH] Use radius instead of rw when defining sliderEdgeOffset A sliderEdgeOffset greater than radius will cause the pointer to draw incorrectly. Using radius instead of radius * 2, which is how we get rw, makes the reasonable bounds of the offset more clear. We could clip it at sliderEdgeOffset > radius, but that seems excessive, as the condition could only obtain due to coder error. --- libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp index 8c75fc11..a944f426 100644 --- a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp +++ b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp @@ -140,7 +140,7 @@ void LookAndFeel::drawRotarySliderBase (juce::Graphics& g, // Increasing this value will cause the pointer to be drawn closer // to the center of the slider. - const auto sliderEdgeOffset = juce::roundToInt (juce::jmax ((rw * .05f), 1.0f)); + const auto sliderEdgeOffset = juce::roundToInt (juce::jmax ((radius * .1f), 1.0f)); const auto pointerY = initialPointerY + sliderEdgeOffset; const auto cornerSize = pointerThickness * .35f;