Gui: Apply Law of Demeter to starting and stopping animations

This commit is contained in:
Rexbas
2023-10-24 22:05:20 +02:00
committed by wwmayer
parent 8ade932a4f
commit 796c2189e4
3 changed files with 19 additions and 12 deletions

View File

@@ -1067,9 +1067,19 @@ SbBool NavigationStyle::isAnimating() const
return this->currentmode == NavigationStyle::SPINNING;
}
NavigationAnimator* NavigationStyle::getAnimator() const
void NavigationStyle::startAnimating(const std::shared_ptr<NavigationAnimation>& animation, bool wait) const
{
return this->animator;
if (wait) {
animator->startAndWait(animation);
}
else {
animator->start(animation);
}
}
void NavigationStyle::stopAnimating() const
{
animator->stop();
}
void NavigationStyle::setSensitivity(float val)