summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Varanka <sami.varanka@qt.io>2021-06-16 08:49:34 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-22 07:20:00 +0000
commit0de43933a09e079dad2caf5a8e7e84f5801e2c87 (patch)
treefa6dcfb79853b7d1532cec1d5452161cb2ceb00c /src
parent7d62115363d08da07e5fe50d5ca9869ba7b896be (diff)
Fix: Axis titles do not respect title fixed
When a graph is rotated so that it is viewed from below the y axis gets flipped. However, x and z axis were not rotated correctly which caused them to be unvisible. Fixes: QTBUG-94441 Change-Id: Ic56b910ce790526fd0460aa895ce978e6efd0b23 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit 3333795ff1f60d4f68ee7bdab5ef129b23121efb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/datavisualization/engine/abstract3drenderer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp
index 54487ba1..9b8bc13a 100644
--- a/src/datavisualization/engine/abstract3drenderer.cpp
+++ b/src/datavisualization/engine/abstract3drenderer.cpp
@@ -941,12 +941,27 @@ void Abstract3DRenderer::drawAxisTitleX(const QVector3D &labelRotation,
xRotation = -90.0f - labelRotation.z();
extraRotation = -extraRotation;
}
+ if (m_yFlipped) {
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ if (m_xFlipped)
+ xRotation = 90.0f + labelRotation.z();
+ else
+ xRotation = 90.0f - labelRotation.z();
+ }
} else {
if (m_xFlipped) {
offsetRotation = -offsetRotation;
xRotation = -90.0f - labelRotation.z();
extraRotation = -extraRotation;
}
+ if (m_yFlipped) {
+ xRotation = 90.0f + labelRotation.z();
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ if (m_xFlipped)
+ xRotation = 90.0f - labelRotation.z();
+ }
}
}
@@ -1038,6 +1053,11 @@ void Abstract3DRenderer::drawAxisTitleZ(const QVector3D &labelRotation,
yRotation = -yRotation;
}
}
+ if (m_yFlipped) {
+ xRotation = -xRotation;
+ alignment = Qt::AlignBottom;
+ extraRotation = -extraRotation;
+ }
}
float offsetRotation = zRotation;