@@ -10,7 +10,7 @@ CustomKnobLNF::CustomKnobLNF() {
1010}
1111
1212void CustomKnobLNF::drawRotarySlider (juce::Graphics& g, int x, int y, int width, int height,
13- float sliderPosProportional, float , float , juce::Slider&) {
13+ float sliderPosProportional, float , float , juce::Slider& slider ) {
1414 if (knobImage.isValid ()) {
1515 int frameWidth = knobImage.getWidth ();
1616 int frameHeight = knobImage.getHeight () / numFrames;
@@ -28,21 +28,11 @@ void CustomKnobLNF::drawRotarySlider(juce::Graphics& g, int x, int y, int width,
2828 destX, destY, scaledWidth, scaledHeight,
2929 0 , frameIndex * frameHeight,
3030 frameWidth, frameHeight);
31- }
32- }
3331
34- juce::BorderSize<int > CustomKnobLNF::getLabelBorderSize (juce::Label&)
35- {
36- return juce::BorderSize<int >(0 );
32+ g.setColour (juce::Colours::white);
33+ g.setFont (juce::Font (" Arial" , 30 .0f , juce::Font::bold));
34+ juce::String text = slider.getTextFromValue (slider.getValue ());
35+ g.drawText (text, destX, destY, scaledWidth, scaledHeight, juce::Justification::centred);
36+ }
3737}
3838
39- juce::Label* CustomKnobLNF::createSliderTextBox (juce::Slider& slider)
40- {
41- auto * l = new juce::Label ();
42- l->setJustificationType (juce::Justification::centred);
43- l->setColour (juce::Label::textColourId, slider.findColour (juce::Slider::textBoxTextColourId));
44- l->setColour (juce::Label::backgroundColourId, juce::Colours::transparentBlack);
45- l->setColour (juce::Label::outlineColourId, juce::Colours::transparentBlack);
46- l->setFont (juce::Font (" Arial" , 30 .0f , juce::Font::bold));
47- return l;
48- }
0 commit comments