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:
parent
31025ae3e6
commit
18571feb61
1 changed files with 9 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue