summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-09-13 10:58:15 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-09-13 11:09:06 +0300
commitb29a2d2b581151634afe81e5f6408a6918295ea5 (patch)
treebb571f38c6e27432cae824ae7f1aaf9e6fd053a9
parentae6469e69cb9ed5a14c583ac8dfb603ed4f263c8 (diff)
Bar selection is highlighted in slice view
Task-number: QTRD-2259 Change-Id: Ia7143073eafd9b2c517ea33c7c9126a1041eb8fa Change-Id: Ia7143073eafd9b2c517ea33c7c9126a1041eb8fa Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
-rw-r--r--src/datavisualization/engine/bars3drenderer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/datavisualization/engine/bars3drenderer.cpp b/src/datavisualization/engine/bars3drenderer.cpp
index 53c5cf6e..558eb48e 100644
--- a/src/datavisualization/engine/bars3drenderer.cpp
+++ b/src/datavisualization/engine/bars3drenderer.cpp
@@ -213,7 +213,6 @@ void Bars3DRenderer::render(GLuint defaultFboHandle)
// If slicing has been activated by this render pass, we need another render
if (slicingActivated != m_cachedScene->isSlicingActivated())
emit needRender();
-
}
void Bars3DRenderer::drawSlicedScene(const LabelItem &xLabel,
@@ -294,8 +293,12 @@ void Bars3DRenderer::drawSlicedScene(const LabelItem &xLabel,
QVector3D heightColor = Utils::vectorFromColor(m_cachedTheme.m_heightColor) * item->height();
QVector3D barColor = baseColor + heightColor;
+ if (m_selection.x() == item->position().x() && m_selection.y() == item->position().y())
+ barColor = Utils::vectorFromColor(m_cachedTheme.m_highlightBarColor);
#else
QVector3D barColor = Utils::vectorFromColor(m_cachedTheme.m_baseColor);
+ if (m_selection.x() == item->position().x() && m_selection.y() == item->position().y())
+ barColor = Utils::vectorFromColor(m_cachedTheme.m_highlightBarColor);
#endif
if (item->height() != 0) {
@@ -412,8 +415,6 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
GLfloat colPos = 0;
GLfloat rowPos = 0;
- //m_selection = selectionSkipColor;
-
// Specify viewport
glViewport(m_mainViewPort.x(), m_mainViewPort.y(),
m_mainViewPort.width(), m_mainViewPort.height());
@@ -477,7 +478,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
QMatrix4x4 depthProjectionMatrix;
#if !defined(QT_OPENGL_ES_2)
- if (m_cachedShadowQuality > QDataVis::ShadowNone/*!m_cachedIsSlicingActivated*/) {
+ if (m_cachedShadowQuality > QDataVis::ShadowNone /*&& !m_cachedIsSlicingActivated*/) {
// Render scene into a depth texture for using with shadow mapping
// Enable drawing to depth framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, m_depthFrameBuffer);
@@ -776,7 +777,7 @@ void Bars3DRenderer::drawScene(GLuint defaultFboHandle)
barColor = Utils::vectorFromColor(m_cachedTheme.m_highlightBarColor);
lightStrength = m_cachedTheme.m_highlightLightStrength;
// Insert position data into render item. We have no ownership, don't delete the previous one
- if (!m_cachedIsSlicingActivated) {
+ if (selectionDirty) {
selectedBar = &item;
selectedBar->setPosition(QPoint(row, bar));
item.setTranslation(modelMatrix.column(3).toVector3D());