mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Let defaullt text alignment be decided in default_config
This commit is contained in:
parent
117a34dc67
commit
83b4aa6b88
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue