QmlDesigner: Fix icon gizmo position update after edit camera change

Changing edit camera could take a couple of frames to propagate the
the correct position to icon gizmos. It's unclear why exactly this
happens, but a trivial fix is to just render a couple of extra frames
whenever the camera changes.

Change-Id: I8c4fc33bff9cb7a4c4ac3b5105327cc5eb0a45d5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2020-03-19 17:04:41 +02:00
parent ea16d20804
commit 7c09d34feb
@@ -1158,6 +1158,7 @@ void Qt5InformationNodeInstanceServer::inputEvent(const InputEventCommand &comma
void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &command)
{
QVariantMap updatedState;
int renderCount = 1;
switch (command.type()) {
case View3DActionCommand::MoveTool:
@@ -1177,6 +1178,8 @@ void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &c
break;
case View3DActionCommand::CameraToggle:
updatedState.insert("usePerspective", command.isEnabled());
// It can take a couple frames to properly update icon gizmo positions, so render 3 frames
renderCount = 3;
break;
case View3DActionCommand::OrientationToggle:
updatedState.insert("globalOrientation", command.isEnabled());
@@ -1194,7 +1197,7 @@ void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &c
Q_ARG(QVariant, QVariant::fromValue(false)));
}
render3DEditView();
render3DEditView(renderCount);
}
void Qt5InformationNodeInstanceServer::changeAuxiliaryValues(const ChangeAuxiliaryCommand &command)