Browse Source

Made rendering engine choice persist when ComponentPeers are re-created.

tags/2021-05-28
jules 13 years ago
parent
commit
3555b6e9d5
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      modules/juce_gui_basics/components/juce_Component.cpp

+ 6
- 0
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -565,6 +565,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
bool wasMinimised = false;
ComponentBoundsConstrainer* currentConstainer = nullptr;
Rectangle<int> oldNonFullScreenBounds;
int oldRenderingEngine = -1;
if (peer != nullptr)
{
@@ -574,6 +575,7 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
wasMinimised = peer->isMinimised();
currentConstainer = peer->getConstrainer();
oldNonFullScreenBounds = peer->getNonFullScreenBounds();
oldRenderingEngine = peer->getCurrentRenderingEngine();
flags.hasHeavyweightPeerFlag = false;
Desktop::getInstance().removeDesktopComponent (this);
@@ -598,6 +600,10 @@ void Component::addToDesktop (int styleWanted, void* nativeWindowToAttachTo)
bounds.setPosition (topLeft);
peer->setBounds (topLeft.x, topLeft.y, getWidth(), getHeight(), false);
if (oldRenderingEngine >= 0)
peer->setCurrentRenderingEngine (oldRenderingEngine);
peer->setVisible (isVisible());
peer = ComponentPeer::getPeerFor (this);


Loading…
Cancel
Save