summaryrefslogtreecommitdiffstats
path: root/src/datavisualization/engine/surface3drenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/datavisualization/engine/surface3drenderer.cpp')
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index 12627966..858f0283 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -1913,8 +1913,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);
@@ -2032,8 +2033,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 +2127,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,