From b28f030874d514dfc1393f5a7156f202556f3730 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sun, 4 Aug 2019 10:43:00 -0500 Subject: [PATCH] [CanvasText] Restore support for OSG 3.4 --- simgear/canvas/elements/CanvasText.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/simgear/canvas/elements/CanvasText.cxx b/simgear/canvas/elements/CanvasText.cxx index 060436e1..9e4e88b9 100644 --- a/simgear/canvas/elements/CanvasText.cxx +++ b/simgear/canvas/elements/CanvasText.cxx @@ -324,11 +324,13 @@ namespace canvas //---------------------------------------------------------------------------- #if OSG_VERSION_LESS_THAN(3,6,5) TextLine Text::TextOSG::nearestLine(float pos_y) const + { + osgText::Font const* font = getActiveFont(); #else TextLine Text::TextOSG::nearestLine(float pos_y) -#endif { auto font = getActiveFont(); +#endif if( !font || lineCount() <= 0 ) return TextLine(0, this); @@ -360,7 +362,12 @@ namespace canvas if( _text.empty() ) return SGVec2i(0, 0); +#if OSG_VERSION_LESS_THAN(3,6,5) + osgText::Font* activefont = const_cast(getActiveFont()); +#else auto activefont = getActiveFont(); +#endif + if( !activefont ) return SGVec2i(-1, -1);