From Tree, addition of ; after MACRO_'s to help with Java port.

From Tree + Robert, Addition of LEFT_BASE_LINE,RIGHT_BASE_LINE,CENTER_BASE_LINE
Alignment options in Text.
This commit is contained in:
Robert Osfield
2003-04-27 10:58:39 +00:00
parent 9fb98c0107
commit c1b1a091fa
7 changed files with 49 additions and 17 deletions

View File

@@ -97,6 +97,9 @@ bool Text_readLocalData(osg::Object &obj, osgDB::Input &fr)
else if (str=="RIGHT_TOP") text.setAlignment(osgText::Text::RIGHT_TOP);
else if (str=="RIGHT_CENTER") text.setAlignment(osgText::Text::RIGHT_CENTER);
else if (str=="RIGHT_BOTTOM") text.setAlignment(osgText::Text::RIGHT_BOTTOM);
else if (str=="LEFT_BASE_LINE") text.setAlignment(osgText::Text::LEFT_BASE_LINE);
else if (str=="CENTER_BASE_LINE") text.setAlignment(osgText::Text::CENTER_BASE_LINE);
else if (str=="RIGHT_BASE_LINE") text.setAlignment(osgText::Text::RIGHT_BASE_LINE);
else if (str=="BASE_LINE") text.setAlignment(osgText::Text::BASE_LINE);
fr += 2;
itAdvanced = true;
@@ -255,7 +258,9 @@ bool Text_writeLocalData(const osg::Object &obj, osgDB::Output &fw)
case osgText::Text::RIGHT_CENTER: fw << "RIGHT_CENTER" << std::endl; break;
case osgText::Text::RIGHT_BOTTOM: fw << "RIGHT_BOTTOM" << std::endl; break;
case osgText::Text::BASE_LINE: fw << "BASE_LINE" << std::endl; break;
case osgText::Text::LEFT_BASE_LINE: fw << "LEFT_BASE_LINE" << std::endl; break;
case osgText::Text::CENTER_BASE_LINE:fw << "CENTER_BASE_LINE" << std::endl; break;
case osgText::Text::RIGHT_BASE_LINE: fw << "RIGHT_BASE_LINE" << std::endl; break;
};

View File

@@ -416,7 +416,9 @@ void Text::computePositions()
case RIGHT_TOP: _offset.set(_textBB.xMax(),_textBB.yMax(),_textBB.zMin()); break;
case RIGHT_CENTER: _offset.set(_textBB.xMax(),(_textBB.yMax()+_textBB.yMin())*0.5f,_textBB.zMin()); break;
case RIGHT_BOTTOM: _offset.set(_textBB.xMax(),_textBB.yMin(),_textBB.zMin()); break;
case BASE_LINE: _offset.set(0.0f,0.0f,0.0f); break;
case LEFT_BASE_LINE: _offset.set(0.0f,0.0f,0.0f); break;
case CENTER_BASE_LINE: _offset.set((_textBB.xMax()+_textBB.xMin())*0.5f,0.0f,0.0f); break;
case RIGHT_BASE_LINE: _offset.set((_textBB.xMax()+_textBB.xMin()),0.0f,0.0f); break;
}
// adjust offset for axis alignment