summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-09-17 14:10:52 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-09-18 07:44:03 +0000
commitefbdd0c4d1b6c91259bb1eda6cc8f5c5c4ccd41b (patch)
tree3651bab985275af06e1e094f1ddac1ee624ec676
parent1bc6fe6f10507a2bbcca744fe8b906bc89cfc396 (diff)
Properly initialize drag when dragging camera or lights
Task-number: QT3DS-2294 Change-Id: I5f6d7f0a4d2a36e63103fd940c3bb67c5806242a Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Studio/Render/StudioRendererTranslation.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp
index 9990ae6d..18eeaf9c 100644
--- a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp
+++ b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp
@@ -3000,8 +3000,11 @@ SStudioPickValue STranslation::Pick(CPt inMouseCoords, TranslationSelectMode::En
const SGraphObject &theObject = *thePickResult.m_HitObject;
// check hit distance to cameras and lights
- if (lastIndex != -1 && thePickResult.m_CameraDistanceSq > lastDist * lastDist)
+ if (lastIndex != -1 && thePickResult.m_CameraDistanceSq > lastDist * lastDist) {
+ DoPrepareForDrag(static_cast<SNode *>(
+ &(m_editModeCamerasAndLights[lastIndex]->GetGraphObject())));
return m_editModeCamerasAndLights[lastIndex]->GetInstanceHandle();
+ }
if (theObject.m_Type == GraphObjectTypes::Model
|| theObject.m_Type == GraphObjectTypes::Text
@@ -3074,8 +3077,11 @@ SStudioPickValue STranslation::Pick(CPt inMouseCoords, TranslationSelectMode::En
RequestRender();
}
- if (lastIndex != -1)
+ if (lastIndex != -1) {
+ DoPrepareForDrag(static_cast<SNode *>(
+ &(m_editModeCamerasAndLights[lastIndex]->GetGraphObject())));
return m_editModeCamerasAndLights[lastIndex]->GetInstanceHandle();
+ }
return SStudioPickValue();
}