adapt code to the text mapping fix

Change-Id: I8fd22529a0749f9bf1bff75534dca61f2f65312b
This commit is contained in:
Markus Mohrhard
2014-05-24 10:35:07 +02:00
committed by Markus Mohrhard
parent 2c75e66968
commit f3c47df816

View File

@@ -104,8 +104,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++)); maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++));
opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back()); opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back());
glm::vec3 aTopLeft, aTopRight, aBottomRight; glm::vec3 aTopLeft, aTopRight, aBottomRight;
aTopLeft.x = calculateTextWidth(aSeriesName) * -1.0; aTopLeft.x = 0.0f;
aTopLeft.y = nYPos; aTopLeft.y = nYPos;
aTopRight.x = calculateTextWidth(aSeriesName) * -1.0;
aTopRight.y = nYPos; aTopRight.y = nYPos;
aBottomRight = aTopRight; aBottomRight = aTopRight;
aBottomRight.y += TEXT_HEIGHT; aBottomRight.y += TEXT_HEIGHT;
@@ -182,12 +183,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aCats[i], nId++)); maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aCats[i], nId++));
opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back()); opengl3D::Text* p = static_cast<opengl3D::Text*>(&maShapes.back());
aTopLeft.x = nXPos; aTopLeft.x = nXPos + TEXT_HEIGHT;
aTopLeft.y = nYPos; aTopLeft.y = nYPos + calculateTextWidth(aCats[i]);
aTopRight = aTopLeft; aTopRight = aTopLeft;
aTopRight.x += calculateTextWidth(aCats[i]); aTopRight.y = nYPos;
aBottomRight = aTopRight; aBottomRight.x = nXPos;
aBottomRight.y += TEXT_HEIGHT; aBottomRight.y = nYPos;
p->setPosition(aTopLeft, aTopRight, aBottomRight); p->setPosition(aTopLeft, aTopRight, aBottomRight);
} }
} }