From 0de43933a09e079dad2caf5a8e7e84f5801e2c87 Mon Sep 17 00:00:00 2001 From: Sami Varanka Date: Wed, 16 Jun 2021 08:49:34 +0300 Subject: Fix: Axis titles do not respect title fixed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ää (cherry picked from commit 3333795ff1f60d4f68ee7bdab5ef129b23121efb) Reviewed-by: Qt Cherry-pick Bot --- src/datavisualization/engine/abstract3drenderer.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') 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; -- cgit v1.2.3