In drawRotarySlider size is always zero

Hello,
there is method in LookAndFeel_V4:
void drawRotarySlider(Graphics &g, int x, int y, int width, int height, float sliderPos, float rotaryStartAngle, float rotaryEndAngle, Slider &slider)

And the width and height are always zero. Even though I set bounds for slider with that lookAndFeel.

if I call g.fillAll() then the whole slider bounds are filled properly. So the method see the slider size properly, but then why width and height are 0? Does they mean something else then slider size?

For any help great thanks in advance.
Best Regards,

The width and height correspond to the area for the slider image itself, excluding the textbox if there’s one, and any extra space. This is determined by another LnF method, Slider::SliderLayout getSliderLayout (Slider&). SliderLayout has two Rectangle fields, sliderBounds and textBoxBounds. In your case, getSliderLayout is returning a zero size rectangle for sliderBounds.

Great thanks for answer. I found out that I forgot to call on slider resized() and it caused the width and height was zero. Now after I call Slider::resized() everything is fine.

Ah, so you inherit from Slider…
Otherwise the setBounds() trigger a resized() already. But if you override resized() then yes you need to call the base class.