From 97e639058e8dac0e865ce8ae4678e2b9dcd857f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Thu, 9 Jan 2025 09:54:37 -0500 Subject: [PATCH] ui: improve recentering --- .../Scenario/Document/Interval/FullView/NodalIntervalView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/FullView/NodalIntervalView.cpp b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/FullView/NodalIntervalView.cpp index 368dd1b631..2253d06f8e 100644 --- a/src/plugins/score-plugin-scenario/Scenario/Document/Interval/FullView/NodalIntervalView.cpp +++ b/src/plugins/score-plugin-scenario/Scenario/Document/Interval/FullView/NodalIntervalView.cpp @@ -1,6 +1,7 @@ #include "NodalIntervalView.hpp" #include +#include #include #include @@ -86,6 +87,7 @@ NodalIntervalView::NodalIntervalView( } } } + QTimer::singleShot(1, this, &NodalIntervalView::recenterRelativeToView); } void NodalIntervalView::recenterRelativeToView() @@ -143,7 +145,7 @@ void NodalIntervalView::rescale() auto ourCenter = parentRect.center(); auto delta = ourCenter - childCenter; - m_container->setPos(delta); + m_container->setPos(delta + m_model.nodalOffset()); } NodalIntervalView::~NodalIntervalView()