diff options
-rw-r--r-- | src/Authoring/Studio/Render/StudioRendererTranslation.cpp | 11 | ||||
-rw-r--r-- | src/Authoring/Studio/Render/StudioRendererTranslation.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp index 6d31ae44..752a84d7 100644 --- a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp +++ b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp @@ -2641,6 +2641,17 @@ void STranslation::Render(int inWidgetId, bool inDrawGuides, bool scenePreviewPa } if (object.m_Type == GraphObjectTypes::Camera) { + if (m_InnerRect.isNull()) { + // this happens when the initial view is not the camera view + NVRenderRect thePresentationViewport = m_Context.GetPresentationViewport(); + m_InnerRect.m_Left = thePresentationViewport.m_X; + m_InnerRect.m_Right = thePresentationViewport.m_X + + thePresentationViewport.m_Width; + m_InnerRect.m_Bottom = thePresentationViewport.m_Y; + m_InnerRect.m_Top = thePresentationViewport.m_Y + + thePresentationViewport.m_Height; + } + QT3DSVec2 dim = QT3DSVec2(m_InnerRect.m_Right - m_InnerRect.m_Left, m_InnerRect.m_Top - m_InnerRect.m_Bottom); NVRenderRectF theViewport(0, 0, dim.x, dim.y); diff --git a/src/Authoring/Studio/Render/StudioRendererTranslation.h b/src/Authoring/Studio/Render/StudioRendererTranslation.h index 0a3c7a81..45e86871 100644 --- a/src/Authoring/Studio/Render/StudioRendererTranslation.h +++ b/src/Authoring/Studio/Render/StudioRendererTranslation.h @@ -290,10 +290,16 @@ namespace studio { , m_Bottom(b) { } + bool Contains(QT3DSI32 x, QT3DSI32 y) const { return x >= m_Left && x <= m_Right && y >= m_Bottom && y <= m_Top; } + + bool isNull() const + { + return m_Left == 0 && m_Top == 0 && m_Right == 0 && m_Bottom == 0; + } }; struct SDragPreparationResult |