From bf73938fd13c363da9921a3af708a94088315b01 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sun, 10 Jan 2021 14:10:31 -0800 Subject: [PATCH] Move joint type map to constants --- manimlib/constants.py | 7 +++++++ manimlib/mobject/types/vectorized_mobject.py | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manimlib/constants.py b/manimlib/constants.py index dd678a41..1e24533f 100644 --- a/manimlib/constants.py +++ b/manimlib/constants.py @@ -53,6 +53,13 @@ DEGREES = TAU / 360 FFMPEG_BIN = "ffmpeg" +JOINT_TYPE_MAP = { + "auto": 0, + "round": 1, + "bevel": 2, + "miter": 3, +} + # Related to Text NOT_SETTING_FONT_MSG = ''' Warning: diff --git a/manimlib/mobject/types/vectorized_mobject.py b/manimlib/mobject/types/vectorized_mobject.py index 4a9ca676..e94b9e7e 100644 --- a/manimlib/mobject/types/vectorized_mobject.py +++ b/manimlib/mobject/types/vectorized_mobject.py @@ -974,14 +974,8 @@ class VMobject(Mobject): return result def get_stroke_uniforms(self): - j_map = { - "auto": 0, - "round": 1, - "bevel": 2, - "miter": 3, - } result = super().get_shader_uniforms() - result["joint_type"] = j_map[self.joint_type] + result["joint_type"] = JOINT_TYPE_MAP[self.joint_type] result["flat_stroke"] = float(self.flat_stroke) return result