[CanvasText] Restore support for OSG 3.4
This commit is contained in:
parent
d883ab278d
commit
b28f030874
@ -324,11 +324,13 @@ namespace canvas
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
#if OSG_VERSION_LESS_THAN(3,6,5)
|
#if OSG_VERSION_LESS_THAN(3,6,5)
|
||||||
TextLine Text::TextOSG::nearestLine(float pos_y) const
|
TextLine Text::TextOSG::nearestLine(float pos_y) const
|
||||||
|
{
|
||||||
|
osgText::Font const* font = getActiveFont();
|
||||||
#else
|
#else
|
||||||
TextLine Text::TextOSG::nearestLine(float pos_y)
|
TextLine Text::TextOSG::nearestLine(float pos_y)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
auto font = getActiveFont();
|
auto font = getActiveFont();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !font || lineCount() <= 0 )
|
if( !font || lineCount() <= 0 )
|
||||||
return TextLine(0, this);
|
return TextLine(0, this);
|
||||||
@ -360,7 +362,12 @@ namespace canvas
|
|||||||
if( _text.empty() )
|
if( _text.empty() )
|
||||||
return SGVec2i(0, 0);
|
return SGVec2i(0, 0);
|
||||||
|
|
||||||
|
#if OSG_VERSION_LESS_THAN(3,6,5)
|
||||||
|
osgText::Font* activefont = const_cast<osgText::Font*>(getActiveFont());
|
||||||
|
#else
|
||||||
auto activefont = getActiveFont();
|
auto activefont = getActiveFont();
|
||||||
|
#endif
|
||||||
|
|
||||||
if( !activefont )
|
if( !activefont )
|
||||||
return SGVec2i(-1, -1);
|
return SGVec2i(-1, -1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user