QmlDesigner: Add "closeup" option to focusObjectToCamera function

The closeup option is used for itemlibrary thumbnail generation, where
the regular fit produces too small images on most imports.

Change-Id: I2901a2e20d100b155111f002b22489df945e9e01
Fixes: QDS-1899
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2020-04-23 15:40:41 +03:00
parent a248138685
commit d1a7afa28f
6 changed files with 13 additions and 9 deletions

View File

@@ -87,14 +87,15 @@ Item {
}
function focusObject(targetObject, rotation, updateZoom)
function focusObject(targetObject, rotation, updateZoom, closeUp)
{
if (!camera)
return;
camera.eulerRotation = rotation;
var newLookAtAndZoom = _generalHelper.focusObjectToCamera(
camera, _defaultCameraLookAtDistance, targetObject, view3d, _zoomFactor, updateZoom);
camera, _defaultCameraLookAtDistance, targetObject, view3d, _zoomFactor,
updateZoom, closeUp);
_lookAtPoint = newLookAtAndZoom.toVector3d();
_zoomFactor = newLookAtAndZoom.w;
storeCameraState(0);