diff --git a/osx/tools/graphtool.cpp b/osx/tools/graphtool.cpp index a9c5669d..b451540a 100644 --- a/osx/tools/graphtool.cpp +++ b/osx/tools/graphtool.cpp @@ -13,6 +13,7 @@ #include #include #include +#include using boost::math::constants::pi; cursor_type arrow_curs[3][3] = { @@ -1002,13 +1003,12 @@ void undo_clip(sf::RenderTarget& where) { } void setActiveRenderTarget(sf::RenderTarget& where) { - try { + const std::type_info& type = typeid(where); + if(type == typeid(sf::RenderWindow&)) dynamic_cast(where).setActive(); - } catch(std::bad_cast) { - try { - dynamic_cast(where).setActive(); - } catch(std::bad_cast) {} - } + else if(type == typeid(sf::RenderTexture&)) + dynamic_cast(where).setActive(); + else throw std::bad_cast(); } Region& Region::operator-=(Region& other) {