Move joint type map to constants

This commit is contained in:
Grant Sanderson
2021-01-10 14:10:31 -08:00
parent 8d14b66583
commit bf73938fd1
2 changed files with 8 additions and 7 deletions

View File

@ -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:

View File

@ -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