1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Avoid calling Graphics::fillEllipse() with negative bounds in AudioAppDemo

This commit is contained in:
ed 2018-12-17 09:29:27 +00:00
parent 31025ae3e6
commit 18571feb61

View file

@ -122,11 +122,15 @@ public:
auto centreY = getHeight() / 2.0f;
auto radius = amplitude * 200.0f;
// Draw an ellipse based on the mouse position and audio volume
g.setColour (Colours::lightgreen);
g.fillEllipse (jmax (0.0f, lastMousePosition.x) - radius / 2.0f,
jmax (0.0f, lastMousePosition.y) - radius / 2.0f,
radius, radius);
if (radius >= 0.0f)
{
// Draw an ellipse based on the mouse position and audio volume
g.setColour (Colours::lightgreen);
g.fillEllipse (jmax (0.0f, lastMousePosition.x) - radius / 2.0f,
jmax (0.0f, lastMousePosition.y) - radius / 2.0f,
radius, radius);
}
// Draw a representative sine wave.
Path wavePath;