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