Skip to content

Commit

Permalink
ui: improve recentering
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jan 9, 2025
1 parent 958534f commit 97e6390
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "NodalIntervalView.hpp"

#include <Scenario/Document/ScenarioDocument/ProcessFocusManager.hpp>
#include <Scenario/Document/ScenarioDocument/ScenarioDocumentView.hpp>

#include <score/application/GUIApplicationContext.hpp>
#include <score/graphics/GraphicsItem.hpp>
Expand Down Expand Up @@ -86,6 +87,7 @@ NodalIntervalView::NodalIntervalView(
}
}
}
QTimer::singleShot(1, this, &NodalIntervalView::recenterRelativeToView);
}

void NodalIntervalView::recenterRelativeToView()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 97e6390

Please sign in to comment.