Organize get_ancestors from top to bottom

This commit is contained in:
Grant Sanderson
2022-04-27 09:53:23 -07:00
parent 0e45b41fea
commit ec9ed32d78

View File

@ -359,8 +359,9 @@ class Mobject(object):
if p not in excluded:
ancestors.append(p)
to_process.append(p)
# Remove redundancies while preserving order
# Ensure mobjects highest in the hierarchy show up first
ancestors.reverse()
# Remove list redundancies while preserving order
return list(dict.fromkeys(ancestors))
def add(self, *mobjects: Mobject):