From 4b6722ab44bd87db9a75aa7169b89d016df50701 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 21 Sep 2017 16:01:27 +0100 Subject: [PATCH] Added assignStateSet() to Text::setBackgroundColor() --- examples/osglogo/osglogo.cpp | 12 +++++++++--- src/osgText/Text.cpp | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/osglogo/osglogo.cpp b/examples/osglogo/osglogo.cpp index db0a4bff0..61526fb06 100644 --- a/examples/osglogo/osglogo.cpp +++ b/examples/osglogo/osglogo.cpp @@ -193,9 +193,7 @@ osg:: Node* createTextLeft(const osg::BoundingBox& bb, const std::string& label, //text->setColor(osg::Vec4(0.37f,0.48f,0.67f,1.0f)); // Neil's original OSG colour text->setColor(osg::Vec4(0.20f,0.45f,0.60f,1.0f)); // OGL logo colour - text->setBackdropType(osgText::Text::OUTLINE); - text->setBackdropOffset(0.03f); - text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.5f, 1.0f)); + OSG_NOTICE<setBackdropImplementation(osgText::Text::USE_SHADERS); } + OSG_NOTICE<setBackdropType(osgText::Text::OUTLINE); + text->setBackdropOffset(0.03f); + text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.5f, 1.0f)); + + OSG_NOTICE<setColorGradientMode(osgText::Text::OVERALL); osg::Vec4 lightblue(0.30f,0.6f,0.90f,1.0f); osg::Vec4 blue(0.10f,0.30f,0.40f,1.0f); diff --git a/src/osgText/Text.cpp b/src/osgText/Text.cpp index 227976e28..d67f2dbf1 100644 --- a/src/osgText/Text.cpp +++ b/src/osgText/Text.cpp @@ -1507,6 +1507,8 @@ void Text::setBackdropOffset(float horizontal, float vertical) void Text::setBackdropColor(const osg::Vec4& color) { _backdropColor = color; + + assignStateSet(); } void Text::setColorGradientMode(ColorGradientMode mode)