summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2014-01-29 12:45:48 +0200
committerTomi Korpipää <tomi.korpipaa@digia.com>2014-01-29 12:49:15 +0200
commite616a4737c932546ab5eadee8f4f766d35d260d7 (patch)
treeaea139cda48fb1348655f4b86c0e97f70211d765 /src
parent01e42c90075fcfc5a9275d5161df476797625375 (diff)
Surface slice view scaling fix
Task-number: QTRD-2799 Change-Id: I43650b9b1fb87a112db5e0a233c96c32346def70 Change-Id: I43650b9b1fb87a112db5e0a233c96c32346def70 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/datavisualization/engine/selectionpointer.cpp6
-rw-r--r--src/datavisualization/engine/surface3drenderer.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/datavisualization/engine/selectionpointer.cpp b/src/datavisualization/engine/selectionpointer.cpp
index 4f5e2114..9f3f65bc 100644
--- a/src/datavisualization/engine/selectionpointer.cpp
+++ b/src/datavisualization/engine/selectionpointer.cpp
@@ -91,9 +91,11 @@ void SelectionPointer::render(GLuint defaultFboHandle)
QMatrix4x4 projectionMatrix;
if (m_cachedIsSlicingActivated) {
GLfloat aspect = (GLfloat)m_mainViewPort.width() / (GLfloat)m_mainViewPort.height();
+ GLfloat sliceUnitsScaled = sliceUnits / m_autoScaleAdjustment;
viewMatrix.lookAt(QVector3D(0.0f, 0.0f, 1.0f), zeroVector, upVector);
- projectionMatrix.ortho(-sliceUnits * aspect, sliceUnits * aspect,
- -sliceUnits, sliceUnits, -1.0f, 4.0f);
+ projectionMatrix.ortho(-sliceUnitsScaled * aspect, sliceUnitsScaled * aspect,
+ -sliceUnitsScaled, sliceUnitsScaled,
+ -1.0f, 4.0f);
} else {
viewMatrix = camera->viewMatrix();
projectionMatrix.perspective(45.0f, (GLfloat)m_mainViewPort.width()
diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp
index 82f9eae1..e23af8d4 100644
--- a/src/datavisualization/engine/surface3drenderer.cpp
+++ b/src/datavisualization/engine/surface3drenderer.cpp
@@ -583,8 +583,10 @@ void Surface3DRenderer::drawSlicedScene()
GLfloat aspect = (GLfloat)m_secondarySubViewport.width()
/ (GLfloat)m_secondarySubViewport.height();
- projectionMatrix.ortho(-sliceUnits * aspect, sliceUnits * aspect,
- -sliceUnits, sliceUnits, -1.0f, 4.0f);
+ GLfloat sliceUnitsScaled = sliceUnits / m_autoScaleAdjustment;
+ projectionMatrix.ortho(-sliceUnitsScaled * aspect, sliceUnitsScaled * aspect,
+ -sliceUnitsScaled, sliceUnitsScaled,
+ -1.0f, 4.0f);
// Set view matrix
QMatrix4x4 viewMatrix;