From 159c82802bdcaba531c062ffabe3b4d4c2969908 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 10 Feb 2020 16:13:58 +0200 Subject: [PATCH] QmlDesigner: Maintain grid size while zooming Task-number: QDS-1622 Change-Id: I488b78304866b40b16d17d643816aa899ccb4cd9 Reviewed-by: Miikka Heikkinen --- share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml index ce58f16c14f..5a57595dfbd 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/SceneView3D.qml @@ -39,7 +39,7 @@ View3D { // Empirical cameraZoomFactor values at which the grid zoom level is doubled. The values are // approximately uniformally distributed over the non-linear range of cameraZoomFactor. - readonly property var grid_thresholds: [0.1, 0.265, 0.55, 1.10, 2.35, 4.9, 10.0, 20.5, 42.0, 85.0, 999999.0] + readonly property var grid_thresholds: [0.55, 1.10, 2.35, 4.9, 10.0, 20.5, 42.0, 85.0, 999999.0] property var thresIdx: 1 property var thresPerc: 1.0 // percentage of cameraZoomFactor to the current grid zoom threshold (0.0 - 1.0) @@ -55,7 +55,7 @@ View3D { HelperGrid { id: helperGrid - lines: 20 + Math.round((1 - thresPerc) * 20); + lines: Math.pow(2, grid_thresholds.length - thresIdx - 1); step: 100 * grid_thresholds[0] * Math.pow(2, thresIdx - 1); subdivAlpha: thresPerc; }