diff options
author | Sami Varanka <sami.varanka@qt.io> | 2021-06-16 08:49:34 +0300 |
---|---|---|
committer | Sami Varanka <sami.varanka@qt.io> | 2021-06-22 09:25:39 +0300 |
commit | 3333795ff1f60d4f68ee7bdab5ef129b23121efb (patch) | |
tree | 7d083962249e30370c47630647d431747d830a99 /src/datavisualization/engine | |
parent | 89f5f9950a62b5d6899eb96223ef618968fa0f09 (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.
Pick-to: 6.1
Fixes: QTBUG-94441
Change-Id: Ic56b910ce790526fd0460aa895ce978e6efd0b23
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/datavisualization/engine')
-rw-r--r-- | src/datavisualization/engine/abstract3drenderer.cpp | 20 |
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; |