diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-05-24 10:35:07 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-05-24 10:48:43 +0200 |
commit | f3c47df81680fc220cc9c0b9c8aa447a9cb65ad4 (patch) | |
tree | 0c1479b1abd9d8e77397cf1e6078692ae0060eee | |
parent | 2c75e669689107687183e0ba34b00c22056867a0 (diff) |
adapt code to the text mapping fix
Change-Id: I8fd22529a0749f9bf1bff75534dca61f2f65312b
-rw-r--r-- | chart2/source/view/charttypes/GL3DBarChart.cxx | 13 |
1 files 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<VDataSeries>& rDataSer maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aSeriesName, nId++)); opengl3D::Text* p = static_cast<opengl3D::Text*>(&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<VDataSeries>& rDataSer maShapes.push_back(new opengl3D::Text(mpRenderer.get(), aCats[i], nId++)); opengl3D::Text* p = static_cast<opengl3D::Text*>(&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); } } |