summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/surface3drenderer.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-06-06 10:24:20 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-06-06 10:24:20 +0300
commitee94aedb7447ddf7a779f7188fd1cd2ae44d675e (patch)
treee92e222e7df5e5ce773756ff1d037088c5a61325 /src/datavisualization/engine/surface3drenderer.cpp
parent05364a4204a5ec4c16156ebcad12dd8944c48155 (diff)
parente8e5286ff5c5e5ba822e798dc0c1f8270817a562 (diff)
Merge remote-tracking branch 'origin/develop'
Diffstat (limited to 'src/datavisualization/engine/surface3drenderer.cpp')
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index 12627966..e4dfebfc 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -1838,15 +1838,16 @@ void Surface3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCa
if (m_yFlipped)
labelYTrans = -labelYTrans;
if (labelAutoAngle == 0.0f) {
- labelRotation.setX(-90.0f);
if (m_zFlipped)
labelRotation.setY(180.0f);
if (m_yFlipped) {
if (m_zFlipped)
- labelRotation.setY(0.0f);
- else
labelRotation.setY(180.0f);
- labelRotation.setZ(180.0f);
+ else
+ labelRotation.setY(0.0f);
+ labelRotation.setX(90.0f);
+ } else {
+ labelRotation.setX(-90.0f);
}
} else {
if (m_zFlipped)
@@ -1913,8 +1914,9 @@ void Surface3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCa
endIndex = -1;
indexStep = -1;
}
+ float offsetValue = 0.0f;
for (int label = startIndex; label != endIndex; label = label + indexStep) {
- glPolygonOffset(GLfloat(label) / -10.0f, 1.0f);
+ glPolygonOffset(offsetValue++ / -10.0f, 1.0f);
// Draw the label here
labelTrans.setZ(m_axisCacheZ.labelPosition(label));
m_dummyRenderItem.setTranslation(labelTrans);
@@ -1961,10 +1963,10 @@ void Surface3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCa
labelRotation.setY(-90.0f);
if (m_yFlipped) {
if (m_xFlipped)
- labelRotation.setY(90.0f);
- else
labelRotation.setY(-90.0f);
- labelRotation.setZ(180.0f);
+ else
+ labelRotation.setY(90.0f);
+ labelRotation.setX(90.0f);
}
} else {
if (m_xFlipped)
@@ -2032,8 +2034,9 @@ void Surface3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCa
endIndex = labelCount;
indexStep = 1;
}
+ float offsetValue = 0.0f;
for (int label = startIndex; label != endIndex; label = label + indexStep) {
- glPolygonOffset(GLfloat(label) / -10.0f, 1.0f);
+ glPolygonOffset(offsetValue++ / -10.0f, 1.0f);
// Draw the label here
labelTrans.setX(m_axisCacheX.labelPosition(label));
m_dummyRenderItem.setTranslation(labelTrans);
@@ -2125,11 +2128,12 @@ void Surface3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCa
endIndex = labelCount;
indexStep = 1;
}
+ float offsetValue = 0.0f;
for (int label = startIndex; label != endIndex; label = label + indexStep) {
const LabelItem &axisLabelItem = *m_axisCacheY.labelItems().at(label);
const GLfloat labelYTrans = m_axisCacheY.labelPosition(label);
- glPolygonOffset(GLfloat(label) / -10.0f, 1.0f);
+ glPolygonOffset(offsetValue++ / -10.0f, 1.0f);
if (drawSelection) {
QVector4D labelColor = QVector4D(0.0f, 0.0f, label / 255.0f,