diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2020-09-25 11:45:10 +0300 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2020-09-25 13:33:58 +0300 |
commit | 8931cf0a7b29d5769539c770c79b1b72a8bd86a1 (patch) | |
tree | 5e778a2ae59207dcce35fb137d69ee8680a0576a | |
parent | 98d888b6beeda9e301625ecba8e377cf552e7231 (diff) |
Fix the axis helper scaling in Fit Selected mode
Task-number: QT3DS-4173
Change-Id: I1ba0f83ff930cf3477898a171ff2d1ff2c6a9329
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
-rw-r--r-- | src/Authoring/Qt3DStudio/Render/StudioTranslationWidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Authoring/Qt3DStudio/Render/StudioTranslationWidget.cpp b/src/Authoring/Qt3DStudio/Render/StudioTranslationWidget.cpp index cb2a117d..2b57b5da 100644 --- a/src/Authoring/Qt3DStudio/Render/StudioTranslationWidget.cpp +++ b/src/Authoring/Qt3DStudio/Render/StudioTranslationWidget.cpp @@ -154,7 +154,10 @@ struct STranslationWidget : public SStudioWidgetImpl<StudioWidgetTypes::Translat } helpWidgetInfo.m_Camera->FlipCoordinateSystem(rot); - rot.scale(QT3DSVec4(0.6, 0.6, 0.6, 1)); + // In the scale calculation 200.f = 120 / 0.6; 120 being the default width and 0.6 + // being the default scale for the axis helper + const float scale = float(viewport.m_Width) / 200.f; + rot.scale(QT3DSVec4(scale, scale, scale, 1)); theMVP = theViewProjection * rot.getTranspose(); if (m_wideXAxis == nullptr) { |