summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Authoring/Qt3DStudio/Render/StudioRenderer.cpp8
-rw-r--r--src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp4
-rw-r--r--src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/src/Authoring/Qt3DStudio/Render/StudioRenderer.cpp b/src/Authoring/Qt3DStudio/Render/StudioRenderer.cpp
index ef5c385c..320bca23 100644
--- a/src/Authoring/Qt3DStudio/Render/StudioRenderer.cpp
+++ b/src/Authoring/Qt3DStudio/Render/StudioRenderer.cpp
@@ -1088,18 +1088,20 @@ struct SRendererImpl : public IStudioRenderer,
{
m_MaybeDragStart = false;
m_mouseDown = false;
+ bool guideExists = true;
Qt3DSDMGuideHandle theSelectedGuide;
if (m_PickResult.getType() == StudioPickValueTypes::Guide) {
theSelectedGuide = m_PickResult.getData<Qt3DSDMGuideHandle>();
- m_Translation->CheckGuideInPresentationRect(theSelectedGuide, m_UpdatableEditor);
+ guideExists = m_Translation->CheckGuideInPresentationRect(theSelectedGuide,
+ m_UpdatableEditor);
}
m_UpdatableEditor.CommitEditor();
m_PickResult = SStudioPickValue();
if (m_Translation)
m_Translation->EndDrag();
if (theSelectedGuide.GetHandleValue()) {
- // Get rid of selection if things aren't editable.
- if (m_Doc.GetDocumentReader().AreGuidesEditable())
+ // Get rid of selection if things aren't editable or if guide has been deleted.
+ if (guideExists && m_Doc.GetDocumentReader().AreGuidesEditable())
m_Doc.NotifySelectionChanged(theSelectedGuide);
else
m_Doc.NotifySelectionChanged();
diff --git a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
index 06d6be76..b53084bc 100644
--- a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
+++ b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.cpp
@@ -3980,7 +3980,7 @@ void STranslation::PerformGuideDrag(Qt3DSDMGuideHandle inGuide, CPt inPoint,
inEditor.FireImmediateRefresh(qt3dsdm::Qt3DSDMInstanceHandle());
}
-void STranslation::CheckGuideInPresentationRect(Qt3DSDMGuideHandle inGuide,
+bool STranslation::CheckGuideInPresentationRect(Qt3DSDMGuideHandle inGuide,
CUpdateableDocumentEditor &inEditor)
{
qt3dsdm::SGuideInfo theInfo = m_Doc.GetDocumentReader().GetGuideInfo(inGuide);
@@ -4000,6 +4000,8 @@ void STranslation::CheckGuideInPresentationRect(Qt3DSDMGuideHandle inGuide,
if (!inPresentation)
inEditor.EnsureEditor(QObject::tr("Delete Guide"), __FILE__, __LINE__).DeleteGuide(inGuide);
+
+ return inPresentation;
}
void STranslation::PerformPathDrag(qt3ds::studio::SPathPick &inPathPick, CPt inOriginalCoords,
diff --git a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.h b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.h
index 8f38d8e0..66ae9fcc 100644
--- a/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.h
+++ b/src/Authoring/Qt3DStudio/Render/StudioRendererTranslation.h
@@ -632,7 +632,7 @@ namespace studio {
void PerformGuideDrag(Qt3DSDMGuideHandle inGuide, CPt inPoint,
CUpdateableDocumentEditor &inEditor);
- void CheckGuideInPresentationRect(Qt3DSDMGuideHandle inGuide,
+ bool CheckGuideInPresentationRect(Qt3DSDMGuideHandle inGuide,
CUpdateableDocumentEditor &inEditor);
void PerformPathDrag(qt3ds::studio::SPathPick &inPathPick, CPt inOriginalCoords,