I tried adding the following code to the paint function of a component in a demo project and it rendered as expected, without freezing. I tested on macOS 10.15.7.
const auto largeNumber = 8.68231e6f;
const juce::Rectangle<float> rect { largeNumber, largeNumber };
g.drawRoundedRectangle (rect, 1000.0f, 2.0f);
To investigate further, we’ll need some more information. Which version of JUCE are you using, and which platform are you building for? If you can provide a small program which demonstrates the issue, that will help us to track down the issue more quickly.
In my environment, JUCE v6.0.8, macOS 10.15.6, g.drawRect works fine, but the program stuck in drawRoundedRectangle.
A smaller number than 40.e6f would be able to reproduce the stuck but it seems like not always.
It would be nice if you could try another number as well.
CPU is near 100% and furthermore, occupied memory size increases rapidly.
Basically I would not use such a large number to draw a rectangle, but my program lets users zoom UIs can easily reach the number.
The zoom function is not something I can realize with AffirmTransformation but need to manipulate the component’s bounds.