From b94e9f3a247709ff01b7242495f644a6fe523bb7 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Fri, 4 Nov 2022 12:27:50 -0700 Subject: [PATCH] Fix Restore --- manimlib/animation/transform.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manimlib/animation/transform.py b/manimlib/animation/transform.py index a4bab336..a156f575 100644 --- a/manimlib/animation/transform.py +++ b/manimlib/animation/transform.py @@ -274,9 +274,11 @@ class ShrinkToCenter(ScaleInPlace): super().__init__(mobject, 0, **kwargs) -class Restore(ApplyMethod): +class Restore(Transform): def __init__(self, mobject: Mobject, **kwargs): - super().__init__(mobject.restore, **kwargs) + if not hasattr(mobject, "saved_state") or mobject.saved_state is None: + raise Exception("Trying to restore without having saved") + super().__init__(mobject, mobject.saved_state, **kwargs) class ApplyFunction(Transform):