File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -94,23 +94,14 @@ def remove_invisible_chars(mobject: SVGMobject) -> SVGMobject:
94
94
:class:`~.SVGMobject`
95
95
The SVGMobject without unwanted invisible characters.
96
96
"""
97
- if mobject .__class__ .__name__ == "Text" :
98
- return exclude_dots_from_mobject (mobject [:])
99
- elif mobject .__class__ .__name__ == "Code" :
100
- mobject .code = exclude_dots_from_mobject (mobject .code )
101
- return mobject
102
- else :
103
- return exclude_dots_from_mobject (mobject )
104
-
105
-
106
- def exclude_dots_from_mobject (mobject : SVGMobject ) -> SVGMobject :
107
97
mobject_without_dots = VGroup ()
108
- if mobject [0 ].__class__ == VGroup :
109
- for i in range (len (mobject )):
110
- mobject_without_dots .add (VGroup ())
111
- mobject_without_dots [i ].add (* (k for k in mobject [i ] if k .__class__ != Dot ))
98
+ if isinstance (mobject [0 ], VGroup ):
99
+ for submob in mobject :
100
+ mobject_without_dots .add (
101
+ VGroup (k for k in submob if not isinstance (k , Dot ))
102
+ )
112
103
else :
113
- mobject_without_dots .add (* (k for k in mobject if k . __class__ != Dot ))
104
+ mobject_without_dots .add (* (k for k in mobject if not isinstance ( k , Dot ) ))
114
105
return mobject_without_dots
115
106
116
107
You can’t perform that action at this time.
0 commit comments