diff --git a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp index 5572c536..d4411262 100644 --- a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp +++ b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp @@ -122,8 +122,7 @@ void LookAndFeel::drawKnob (juce::Graphics& g, const float radius, const float toAngle, const juce::Rectangle bounds, - juce::Slider&, - const bool withDropShadow) + juce::Slider&) { const auto centreX = bounds.getCentreX(); const auto centreY = bounds.getCentreY(); @@ -137,63 +136,14 @@ void LookAndFeel::drawKnob (juce::Graphics& g, g.setColour (fillColour); g.fillEllipse (rx, ry, rw, rw); - // Get thicknesses for outline rings... - const auto innerOutlineThickness = juce::roundToInt (juce::jmax ((rw * .05f), 1.0f)); - const auto outerOutlineThickness = innerOutlineThickness * .15f; - - // Offset inner outline by its thickness - auto innerOutlineRadius = radius - (innerOutlineThickness * .5f); - auto innerOutlineRx = centreX - innerOutlineRadius; - auto innerOutlineRy = centreY - innerOutlineRadius; - auto innerOutlineRw = innerOutlineRadius * 2.0f; - - // Draw inner outline - g.setColour (fillColour.darker (.15f)); - g.drawEllipse (innerOutlineRx, - innerOutlineRy, - innerOutlineRw, - innerOutlineRw, - innerOutlineThickness); - - // Offset outer outline by its thickness - auto outerOutlineRadius = radius - (outerOutlineThickness * .5f); - auto outerOutlineRx = centreX - outerOutlineRadius; - auto outerOutlineRy = centreY - outerOutlineRadius; - auto outerOutlineRw = outerOutlineRadius * 2.0f; - - // Draw outer outline - if (withDropShadow) - { - auto xOffset = juce::jmin (juce::roundToInt (innerOutlineThickness * .25), 1); - auto yOffset = juce::jmin (juce::roundToInt (innerOutlineThickness * .5), 1); - - auto shadow = juce::DropShadow (fillColour.darker(), - innerOutlineThickness, - {xOffset, yOffset}); - juce::Path shadowPath; - shadowPath.addEllipse (outerOutlineRx, - outerOutlineRy, - outerOutlineRw, - outerOutlineRw); - shadow.drawForPath (g, shadowPath); - } - else - { - g.setColour (fillColour.darker (.85f)); - g.drawEllipse (outerOutlineRx, - outerOutlineRy, - outerOutlineRw, - outerOutlineRw, - outerOutlineThickness); - } - // Pointer juce::Path p; auto pointerLength = radius * 0.33f; auto pointerThickness = pointerLength * .2f; + const auto pointerY = juce::roundToInt (juce::jmax ((rw * .05f), 1.0f)) - radius; auto cornerSize = pointerThickness * .35f; p.addRoundedRectangle (-pointerThickness * 0.5f, - -radius + innerOutlineThickness, + pointerY, pointerThickness, pointerLength, cornerSize, @@ -239,7 +189,7 @@ void LookAndFeel::drawRotarySlider (juce::Graphics& g, const auto knobRadius = arcRadius * .80f; - drawKnob (g, knobRadius, toAngle, bounds, slider, true); + drawKnob (g, knobRadius, toAngle, bounds, slider); } juce::Font LookAndFeel::getTextButtonFont (juce::TextButton&, int buttonHeight) diff --git a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h index 30329b43..cd6df99e 100644 --- a/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h +++ b/libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.h @@ -52,8 +52,7 @@ class LookAndFeel : public juce::LookAndFeel_V4, const float radius, const float toAngle, const juce::Rectangle bounds, - juce::Slider&, - const bool withDropShadow); + juce::Slider&); void drawRotarySlider (juce::Graphics& g, int x,