Assertion new to JUCE 8.0.2

Hi,

Since JUCE 8.0.2, my application crashes when calling setVisible (true); for the main window:

Assertion failed: (corner_width >= 0 && 2 * corner_width <= CGRectGetWidth(rect)), function CGPathCreateWithRoundedRect, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/Quartz2D/Quartz2D-1161.21.5/CoreGraphics/Paths/CGPath.cc, line 188.

It worked when I built against master September 17, so it looks like it has to be some pretty recent change.

Unfortunately I cannot debug the problem myself as I cannot build JUCE 8 on my machine (my Mac is too old).

Anyone who recognizes this problem?

Erik

We can probably apply a fix on our side but I think this suggests that you’re calling drawRoundedRectangle or fillRoundedRectangle with a corner size that is either < 0, or more likely, more than half the width of the rectangle.

Thanks for your quick answer!

Actually, I only do very minimal custom drawing, it is almost exclusively to drawText. I have no calls to drawRoundedRectangle or fillRoundedRectangle from my code.

The only rounded objects I have in my component are TextButtons.

Maybe the TextButton is just very small? Either way I’m quite sure we can prevent the assertion by clamping the corner size.

It looks like this:

{
    auto r = getLocalBounds();
    auto topR = r.removeFromTop (30);
    settingsButton.setBounds (topR.removeFromLeft (80).reduced (2));
    resetButton.setBounds (topR.removeFromLeft (80).reduced (2));
    soundOffButton.setBounds (topR.removeFromLeft (80).reduced (2));
    // ...
}

With JUCE 8.0.1, I can reduce the size of the window to the point that the buttons disappear one after other when there is no space for them left, without any crashes. So something has happened.

(But note that the problem arising from TextButton was just a hypothesis)