Let defaullt text alignment be decided in default_config

This commit is contained in:
Grant Sanderson 2022-05-24 15:16:59 -07:00
parent 117a34dc67
commit 83b4aa6b88
2 changed files with 4 additions and 1 deletions

View file

@ -28,6 +28,7 @@ tex:
universal_import_line: "from manimlib import *" universal_import_line: "from manimlib import *"
style: style:
font: "Consolas" font: "Consolas"
text_alignment: "LEFT"
background_color: "#333333" background_color: "#333333"
# Set the position of preview window, you can use directions, e.g. UL/DR/OL/OO/... # Set the position of preview window, you can use directions, e.g. UL/DR/OL/OO/...
# also, you can also specify the position(pixel) of the upper left corner of # also, you can also specify the position(pixel) of the upper left corner of

View file

@ -68,7 +68,7 @@ class MarkupText(StringMobject):
"lsh": None, "lsh": None,
"justify": False, "justify": False,
"indent": 0, "indent": 0,
"alignment": "LEFT", "alignment": "",
"line_width": None, "line_width": None,
"font": "", "font": "",
"slant": NORMAL, "slant": NORMAL,
@ -114,6 +114,8 @@ class MarkupText(StringMobject):
if not self.font: if not self.font:
self.font = get_customization()["style"]["font"] self.font = get_customization()["style"]["font"]
if not self.alignment:
self.alignment = get_customization()["style"]["text_alignment"]
if self.is_markup: if self.is_markup:
self.validate_markup_string(text) self.validate_markup_string(text)