diff --git a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp index 7c26c99afa..6f28e8be6f 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp @@ -25,9 +25,7 @@ class ComponentAnimator::AnimationTask { public: - AnimationTask (Component* const comp) noexcept : component (comp) - { - } + AnimationTask (Component* c) noexcept : component (c) {} void reset (const Rectangle& finalBounds, float finalAlpha, @@ -65,8 +63,8 @@ public: bool useTimeslice (const int elapsed) { - if (Component* const c = proxy != nullptr ? static_cast (proxy) - : static_cast (component)) + if (Component* const c = proxy != nullptr ? static_cast (proxy) + : static_cast (component)) { msElapsed += elapsed; double newProgress = msElapsed / (double) msTotal; @@ -149,7 +147,10 @@ public: else jassertfalse; // seem to be trying to animate a component that's not visible.. - image = c.createComponentSnapshot (c.getLocalBounds(), false, getDesktopScaleFactor()); + const float scale = (float) Desktop::getInstance().getDisplays() + .getDisplayContaining (getScreenBounds().getCentre()).scale; + + image = c.createComponentSnapshot (c.getLocalBounds(), false, scale); setVisible (true); toBehind (&c); @@ -189,14 +190,8 @@ private: }; //============================================================================== -ComponentAnimator::ComponentAnimator() - : lastTime (0) -{ -} - -ComponentAnimator::~ComponentAnimator() -{ -} +ComponentAnimator::ComponentAnimator() : lastTime (0) {} +ComponentAnimator::~ComponentAnimator() {} //============================================================================== ComponentAnimator::AnimationTask* ComponentAnimator::findTaskFor (Component* const component) const noexcept