From 14ddfe2c223f05b3b5b0e049720f73ef41b4b9f4 Mon Sep 17 00:00:00 2001 From: reuk Date: Mon, 30 Sep 2024 13:48:43 +0100 Subject: [PATCH] DialogsDemo: Add scope around Graphics instance to ensure drawing is flushed to image before use --- examples/GUI/DialogsDemo.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/GUI/DialogsDemo.h b/examples/GUI/DialogsDemo.h index 0076acc059..8e46bc100a 100644 --- a/examples/GUI/DialogsDemo.h +++ b/examples/GUI/DialogsDemo.h @@ -515,11 +515,14 @@ private: auto myImage = getImageFromAssets ("juce_icon.png"); Image myImage2 (Image::RGB, 500, 500, true); - Graphics g (myImage2); - g.setColour (Colours::green); - ColourGradient gradient (Colours::yellow, 170, 170, Colours::cyan, 170, 20, true); - g.setGradientFill (gradient); - g.fillEllipse (20, 20, 300, 300); + + { + Graphics g (myImage2); + g.setColour (Colours::green); + ColourGradient gradient (Colours::yellow, 170, 170, Colours::cyan, 170, 20, true); + g.setGradientFill (gradient); + g.fillEllipse (20, 20, 300, 300); + } Array images { myImage, myImage2 };