1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-23 01:44:22 +00:00

Added a Visual Studio compiler bug workaround

This commit is contained in:
jules 2017-10-30 15:00:34 +00:00
parent aecb819985
commit f990723d6f

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;
}