From c8325a25c94268f5a95f420746b432e7eddaa2cd Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Thu, 30 May 2019 11:06:50 +0100 Subject: [PATCH] Removed some erroneous callbacks in the JUCESplashScreen component --- .../juce_gui_basics/misc/juce_JUCESplashScreen.cpp | 11 +++++------ modules/juce_gui_basics/misc/juce_JUCESplashScreen.h | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp index 1e6e1cd2a0..3c0b527ade 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp @@ -57,7 +57,7 @@ namespace juce static const int millisecondsToDisplaySplash = 2000, splashScreenFadeOutTime = 2000; static const int splashScreenLogoWidth = 123, splashScreenLogoHeight = 63; static uint32 splashDisplayTime = 0; -static bool appUsageReported = false; +static bool splashHasStartedFading = false, appUsageReported = false; static Rectangle getLogoArea (Rectangle parentRect) @@ -150,7 +150,6 @@ void ReportingThreadContainer::changeListenerCallback (ChangeBroadcaster*) //============================================================================== JUCESplashScreen::JUCESplashScreen (Component& parent) { - ignoreUnused (hasStartedFading); ignoreUnused (parent); #if JUCE_REPORT_APP_USAGE @@ -326,13 +325,13 @@ void JUCESplashScreen::paint (Graphics& g) void JUCESplashScreen::timerCallback() { #if JUCE_DISPLAY_SPLASH_SCREEN - if (isVisible() && ! hasStartedFading) + if (isVisible() && ! splashHasStartedFading) { - hasStartedFading = true; + splashHasStartedFading = true; fader.animateComponent (this, getBounds(), 0.0f, splashScreenFadeOutTime, false, 0, 0); } - if (hasStartedFading && ! fader.isAnimating()) + if (splashHasStartedFading && ! fader.isAnimating()) #endif delete this; } @@ -351,7 +350,7 @@ void JUCESplashScreen::parentHierarchyChanged() bool JUCESplashScreen::hitTest (int x, int y) { - if (! hasStartedFading) + if (! splashHasStartedFading) return getLogoArea (getLocalBounds().toFloat()).contains ((float) x, (float) y); return false; diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h index b8b2209778..3f84aa9839 100644 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h +++ b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h @@ -68,7 +68,6 @@ private: std::unique_ptr content; CriticalSection appUsageReporting; ComponentAnimator fader; - bool hasStartedFading = false; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JUCESplashScreen) };