diff options
Diffstat (limited to 'src/datavisualization/engine/bars3drenderer.cpp')
-rw-r--r-- | src/datavisualization/engine/bars3drenderer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp index 3805e760..04b7f18f 100644 --- a/src/datavisualization/engine/bars3drenderer.cpp +++ b/src/datavisualization/engine/bars3drenderer.cpp @@ -1951,11 +1951,12 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer endIndex = labelCount; indexStep = 1; } + float offsetValue = 0.0f; for (int i = startIndex; i != endIndex; i = i + indexStep) { backLabelTrans.setY(m_axisCacheY.labelPosition(i)); sideLabelTrans.setY(backLabelTrans.y()); - glPolygonOffset(GLfloat(i) / -10.0f, 1.0f); + glPolygonOffset(offsetValue++ / -10.0f, 1.0f); const LabelItem &axisLabelItem = *m_axisCacheY.labelItems().at(i); @@ -2079,6 +2080,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer endIndex = -1; indexStep = -1; } + offsetValue = 0.0f; for (int row = startIndex; row != endIndex; row = row + indexStep) { // Go through all rows and get position of max+1 or min-1 column, depending on x flip // We need only positions for them, labels have already been generated @@ -2088,7 +2090,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer else colPos = colPosValue; - glPolygonOffset(GLfloat(row) / -10.0f, 1.0f); + glPolygonOffset(offsetValue++ / -10.0f, 1.0f); QVector3D labelPos = QVector3D(colPos, labelYAdjustment, // raise a bit over background to avoid depth "glimmering" @@ -2197,6 +2199,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer endIndex = labelCount; indexStep = 1; } + offsetValue = 0.0f; for (int column = startIndex; column != endIndex; column = column + indexStep) { // Go through all columns and get position of max+1 or min-1 row, depending on z flip // We need only positions for them, labels have already been generated @@ -2206,7 +2209,7 @@ void Bars3DRenderer::drawLabels(bool drawSelection, const Q3DCamera *activeCamer else rowPos = rowPosValue; - glPolygonOffset(GLfloat(column) / -10.0f, 1.0f); + glPolygonOffset(offsetValue++ / -10.0f, 1.0f); QVector3D labelPos = QVector3D((colPos - m_rowWidth) / m_scaleFactor, labelYAdjustment, // raise a bit over background to avoid depth "glimmering" |