viewer: don't update if gizmos haven't actually changed

Minor optimization that prevents unnecessary repaints of the viewer viewport.
This commit is contained in:
itsmattkc
2020-05-13 18:26:21 +10:00
parent ce78c168e6
commit 992321a9a5
2 changed files with 18 additions and 4 deletions
+8 -4
View File
@@ -97,16 +97,20 @@ const ViewerSafeMarginInfo &ViewerDisplayWidget::GetSafeMargin() const
void ViewerDisplayWidget::SetSafeMargins(const ViewerSafeMarginInfo &safe_margin)
{
safe_margin_ = safe_margin;
if (safe_margin_ != safe_margin) {
safe_margin_ = safe_margin;
update();
update();
}
}
void ViewerDisplayWidget::SetGizmos(Node *node)
{
gizmos_ = node;
if (gizmos_ != node) {
gizmos_ = node;
update();
update();
}
}
void ViewerDisplayWidget::SetVideoParams(const VideoRenderingParams &params)