Refresh bounding boxes after selection

This commit is contained in:
Grant Sanderson 2023-01-13 14:59:53 -08:00
parent 91f976f7e9
commit 599f74c749

View file

@ -304,13 +304,15 @@ class InteractiveScene(Scene):
if len(mobs) == 0:
return
self.selection.add(*mobs)
self.selection.set_animating_status(True)
for mob in mobs:
mob.set_animating_status(True)
def toggle_from_selection(self, *mobjects: Mobject):
for mob in mobjects:
if mob in self.selection:
self.selection.remove(mob)
mob.set_animating_status(False)
mob.refresh_bounding_box()
else:
self.add_to_selection(mob)
self.refresh_static_mobjects()
@ -318,6 +320,7 @@ class InteractiveScene(Scene):
def clear_selection(self):
for mob in self.selection:
mob.set_animating_status(False)
mob.refresh_bounding_box()
self.selection.set_submobjects([])
self.refresh_static_mobjects()