Skip to content

Commit

Permalink
Tweak slider pointer drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Jan 6, 2024
1 parent 6f6bb3e commit aa6daee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/tote_bag/juce_gui/lookandfeel/LookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ void LookAndFeel::drawRotarySliderBase (juce::Graphics& g,
g.fillEllipse (rx, ry, rw, rw);

juce::Path p;
const auto pointerLength = radius * 0.33f;
const auto pointerThickness = radius * .066f;
const auto pointerLength = radius * 0.41f;
const auto pointerThickness = radius * .085f;
const auto pointerX = -pointerThickness * 0.5f;
const auto initialPointerY = -radius;

// Increasing this value will cause the pointer to be drawn closer
// to the center of the slider.
const auto sliderEdgeOffset = juce::roundToInt (juce::jmax ((radius * .1f), 1.0f));
const auto sliderEdgeOffset = juce::roundToInt (juce::jmax ((radius * .12f), 1.0f));
const auto pointerY = initialPointerY + sliderEdgeOffset;

const auto cornerSize = pointerThickness * .35f;
const auto cornerSize = pointerThickness * .5f;

p.addRoundedRectangle (pointerX,
pointerY,
Expand Down

0 comments on commit aa6daee

Please sign in to comment.