From 9b3e60f5ce20b8decc051f215f8dc8995ff0716f Mon Sep 17 00:00:00 2001 From: xy-23 Date: Fri, 16 Aug 2019 15:53:36 +0800 Subject: [PATCH] Update some Text Mobject changes --- manimlib/constants.py | 2 +- manimlib/mobject/svg/svg_mobject.py | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/manimlib/constants.py b/manimlib/constants.py index 57ec438c..82d2298d 100644 --- a/manimlib/constants.py +++ b/manimlib/constants.py @@ -38,7 +38,7 @@ def initialize_directories(config): "directory were both passed" ) - TEX_DIR = config["tex_dir"] or os.path.join(MEDIA_DIR, "texs") + TEX_DIR = config["tex_dir"] or os.path.join(MEDIA_DIR, "Tex") TEXT_DIR = os.path.join(MEDIA_DIR, "texts") if not video_path_specified: VIDEO_DIR = os.path.join(MEDIA_DIR, "videos") diff --git a/manimlib/mobject/svg/svg_mobject.py b/manimlib/mobject/svg/svg_mobject.py index 219134f9..4798003a 100644 --- a/manimlib/mobject/svg/svg_mobject.py +++ b/manimlib/mobject/svg/svg_mobject.py @@ -286,17 +286,11 @@ class SVGMobject(VMobject): def flatten(self, input_list): output_list = [] - while True: - if input_list == []: - break - for index, i in enumerate(input_list): - if type(i)== list: - input_list = i + input_list[index+1:] - break - else: - output_list.append(i) - input_list.pop(index) - break + for i in input_list: + if isinstance(i, list): + output_list.extend(self.flatten(i)) + else: + output_list.append(i) return output_list def get_all_childNodes_have_id(self, element):