Remove redundant API calls from EditorViewportWidget and use new WorldToScreen call (#4022)
* remove redundant API calls from EditorViewportWidget and use new WorldToScreen call Signed-off-by: hultonha <hultonha@amazon.co.uk> * remove additional pre/post widget render calls that are no longer required Signed-off-by: hultonha <hultonha@amazon.co.uk>
This commit is contained in:
@@ -43,12 +43,7 @@
|
||||
void QtViewport::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
|
||||
{
|
||||
context.m_hitLocation = AZ::Vector3::CreateZero();
|
||||
|
||||
PreWidgetRendering(); // required so that the current render cam is set.
|
||||
|
||||
context.m_hitLocation = GetHitLocation(pt);
|
||||
|
||||
PostWidgetRendering();
|
||||
}
|
||||
|
||||
|
||||
@@ -1352,28 +1347,6 @@ bool QtViewport::MouseCallback(EMouseEvent event, const QPoint& point, Qt::Keybo
|
||||
return true;
|
||||
}
|
||||
|
||||
// RAII wrapper for Pre / PostWidgetRendering calls.
|
||||
// It also tracks the times a mouse callback potentially created a new viewport context.
|
||||
struct ScopedProcessingMouseCallback
|
||||
{
|
||||
explicit ScopedProcessingMouseCallback(QtViewport* viewport)
|
||||
: m_viewport(viewport)
|
||||
{
|
||||
m_viewport->m_processingMouseCallbacksCounter++;
|
||||
m_viewport->PreWidgetRendering();
|
||||
}
|
||||
|
||||
~ScopedProcessingMouseCallback()
|
||||
{
|
||||
m_viewport->PostWidgetRendering();
|
||||
m_viewport->m_processingMouseCallbacksCounter--;
|
||||
}
|
||||
|
||||
QtViewport* m_viewport;
|
||||
};
|
||||
|
||||
ScopedProcessingMouseCallback scopedProcessingMouseCallback(this);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Hit test gizmo objects.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user