# HG changeset patch # User Tarjei Kvamme # Date 1323786952 -3600 # Node ID 92bf2633a0df343745f97fcef3918b38948d2156 # Parent 618379ae34cc05111172daf2d99e11cbb8c6873c SIMRESERVOIR-3849: Use textMaterial to color the text when using an SmTextureText2Collector, as is done otherwise. diff -r 618379ae34cc -r 92bf2633a0df lib/SmallChange/nodekits/SmAnnotationAxis.cpp --- a/lib/SmallChange/nodekits/SmAnnotationAxis.cpp Mon Nov 07 15:12:04 2011 +0100 +++ b/lib/SmallChange/nodekits/SmAnnotationAxis.cpp Tue Dec 13 15:35:52 2011 +0100 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -191,26 +190,26 @@ } if (SmTextureText2CollectorElement::isCollecting(state)) { if (this->annotation.getNum()) { - SmTextureText2 * t = static_cast(this->getAnyPart("text", TRUE)); + SoMaterial * material = static_cast(this->getAnyPart("textMaterial", TRUE)); + SmTextureText2 * text = static_cast(this->getAnyPart("text", TRUE)); SbMatrix modelmatrix = SoModelMatrixElement::get(state); SbVec3f pos; - SbColor4f col(SoLazyElement::getDiffuse(state, 0), - 1.0f - SoLazyElement::getTransparency(state, 0)); + SbColor4f col(material->diffuseColor[0], 1.0f - material->transparency[0]); for (int i = 0; i < l1.getLength(); i++) { pos = this->annotationPos[l1[i]] + this->annotationOffset.getValue(); modelmatrix.multVecMatrix(pos, pos); SmTextureText2CollectorElement::add(state, - this->annotation.getValues(0)[l1[i]%this->annotation.getNum()], + this->annotation.getValues(0)[l1[i] % this->annotation.getNum()], SmTextureFontElement::get(state), pos, -1.0, col, - static_cast(t->justification.getValue()), - static_cast(t->verticalJustification.getValue())); + static_cast(text->justification.getValue()), + static_cast(text->verticalJustification.getValue())); - if (t->string.getNum()) t->string.setNum(0); + if (text->string.getNum()) text->string.setNum(0); } } }