Bug in Slider::PopupDisplayComponent & AffineTransform?

I have a slider with a popup component, which displays its value (using slider.setPopupDisplayEnabled). Normally that works fine. But if I put the slider inside a Component and then scale down this component using an AffineTransform, it looks off.

In worst case the popup display does not update at all. But in some cases it can just look broken. Here is an example, where some digits are only shown partly:
Slider_Popup_Bug
I this case, the left half of the popup display gets updated, but the right half not.

The error only appears on OSX. Cant reproduce it on Windows 10.

Here is a short example code, to generate the error:

class ScaledSlider : public Component
{
public:
    ScaledSlider()
    {
        slider.setTextBoxStyle(Slider::TextEntryBoxPosition::NoTextBox, true, 10, 10);
        slider.setPopupDisplayEnabled(true, false, nullptr);
        addAndMakeVisible(slider);
    }
    
    void resized()
    {
        slider.setBounds(50,50, 200, 50);
    }
    
private:
    Slider slider;
};

class MainComponent : public Component
{
public:
    MainComponent()
    {
        addAndMakeVisible(scaledSlider);
    }
    
    void resized() override
    {
        scaledSlider.setTransform(AffineTransform::scale(0.55));
        scaledSlider.setBounds(0,0, 300,300);
    }
    
private:
    ScaledSlider scaledSlider;
};

I am using JUCE 5.4.5 on OSX 10.14.6. The application is a standalone plugin.

Hi

I’m also having this issue with JUCE 6.1.5. Do you have any solution or workaround with the recent version of JUCE?

No, I don’t have a workaround unfortunately. I decided to not use AffineTransforms.

In case anyone had the same problem.

I ended up not using Slider::PopUpDisplayComponent and adding my own BubbleMessageComponent to my custom Slider with scaled font size, because i still need to use AffineTransform.

It renders fine as expected.

Though, i hope JUCE implementation of Slider::PopUpDisplayComponent could be fixed thus we could just use the feature which already there.

1 Like