From f3c47df81680fc220cc9c0b9c8aa447a9cb65ad4 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 24 May 2014 10:35:07 +0200 Subject: [PATCH] adapt code to the text mapping fix Change-Id: I8fd22529a0749f9bf1bff75534dca61f2f65312b --- chart2/source/view/charttypes/GL3DBarChart.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 02161bc34c35..efd27af848c3 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -104,8 +104,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector& rDataSer maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++)); opengl3D::Text* p = static_cast(&maShapes.back()); glm::vec3 aTopLeft, aTopRight, aBottomRight; - aTopLeft.x = calculateTextWidth(aSeriesName) * -1.0; + aTopLeft.x = 0.0f; aTopLeft.y = nYPos; + aTopRight.x = calculateTextWidth(aSeriesName) * -1.0; aTopRight.y = nYPos; aBottomRight = aTopRight; aBottomRight.y += TEXT_HEIGHT; @@ -182,12 +183,12 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector& rDataSer maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aCats[i], nId++)); opengl3D::Text* p = static_cast(&maShapes.back()); - aTopLeft.x = nXPos; - aTopLeft.y = nYPos; + aTopLeft.x = nXPos + TEXT_HEIGHT; + aTopLeft.y = nYPos + calculateTextWidth(aCats[i]); aTopRight = aTopLeft; - aTopRight.x += calculateTextWidth(aCats[i]); - aBottomRight = aTopRight; - aBottomRight.y += TEXT_HEIGHT; + aTopRight.y = nYPos; + aBottomRight.x = nXPos; + aBottomRight.y = nYPos; p->setPosition(aTopLeft, aTopRight, aBottomRight); } }