animation: migrate PHLANIMVAR from SP to UP (#12486)

This commit is contained in:
Maximilian Seidler 2025-12-14 19:46:49 +00:00 committed by GitHub
parent e4a8f2b14f
commit 7ccc57eb7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 20 deletions

View file

@ -639,14 +639,13 @@ void CWindow::onMap() {
}
void CWindow::onBorderAngleAnimEnd(WP<CBaseAnimatedVariable> pav) {
const auto PAV = pav.lock();
if (!PAV)
if (!pav)
return;
if (PAV->getStyle() != "loop" || !PAV->enabled())
if (pav->getStyle() != "loop" || !pav->enabled())
return;
const auto PANIMVAR = dc<CAnimatedVariable<float>*>(PAV.get());
const auto PANIMVAR = dc<CAnimatedVariable<float>*>(pav.get());
PANIMVAR->setCallbackOnEnd(nullptr); // we remove the callback here because otherwise setvalueandwarp will recurse this
@ -1912,16 +1911,14 @@ std::optional<Vector2D> CWindow::calculateExpression(const std::string& s) {
}
static void setVector2DAnimToMove(WP<CBaseAnimatedVariable> pav) {
const auto PAV = pav.lock();
if (!PAV)
if (!pav)
return;
CAnimatedVariable<Vector2D>* animvar = dc<CAnimatedVariable<Vector2D>*>(PAV.get());
CAnimatedVariable<Vector2D>* animvar = dc<CAnimatedVariable<Vector2D>*>(pav.get());
animvar->setConfig(g_pConfigManager->getAnimationPropertyConfig("windowsMove"));
const auto PHLWINDOW = animvar->m_Context.pWindow.lock();
if (PHLWINDOW)
PHLWINDOW->m_animatingIn = false;
if (animvar->m_Context.pWindow)
animvar->m_Context.pWindow->m_animatingIn = false;
}
void CWindow::mapWindow() {