Browse Source

Added a Visual Studio compiler bug workaround

tags/2021-05-28
jules 8 years ago
parent
commit
f990723d6f
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      examples/audio plugin host/Source/GraphEditorPanel.cpp

+ 7
- 1
examples/audio plugin host/Source/GraphEditorPanel.cpp View File

@@ -600,8 +600,14 @@ GraphEditorPanel::ConnectorComponent* GraphEditorPanel::getComponentForConnectio
GraphEditorPanel::PinComponent* GraphEditorPanel::findPinAt (Point<float> pos) const
{
for (auto* fc : nodes)
if (auto* pin = dynamic_cast<PinComponent*> (fc->getComponentAt (pos.toInt() - fc->getPosition())))
{
// NB: A Visual Studio optimiser error means we have to put this Component* in a local
// variable before trying to cast it, or it gets mysteriously optimised away..
auto* comp = fc->getComponentAt (pos.toInt() - fc->getPosition());
if (auto* pin = dynamic_cast<PinComponent*> (comp))
return pin;
}
return nullptr;
}


Loading…
Cancel
Save