mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
Merge branch 'master' of github.com:3b1b/manim into video-work
This commit is contained in:
commit
24f5a50f0b
3 changed files with 35 additions and 30 deletions
|
@ -38,8 +38,8 @@ class _LabelledTex(SVGMobject):
|
|||
color_str = "#" + "".join([c * 2 for c in color_str[1:]])
|
||||
return int(color_str[1:], 16) - 1
|
||||
|
||||
def get_mobjects_from(self, element):
|
||||
result = super().get_mobjects_from(element)
|
||||
def get_mobjects_from(self, element, style):
|
||||
result = super().get_mobjects_from(element, style)
|
||||
for mob in result:
|
||||
if not hasattr(mob, "glyph_label"):
|
||||
mob.glyph_label = -1
|
||||
|
|
|
@ -134,15 +134,17 @@ class SVGMobject(VMobject):
|
|||
self.set_width(self.width)
|
||||
|
||||
def init_colors(self, override=False):
|
||||
super().init_colors(override=False)
|
||||
super().init_colors(override=override)
|
||||
|
||||
def init_points(self):
|
||||
doc = minidom.parse(self.file_path)
|
||||
self.ref_to_element = {}
|
||||
|
||||
for child in doc.childNodes:
|
||||
if not isinstance(child, minidom.Element): continue
|
||||
if child.tagName != 'svg': continue
|
||||
if not isinstance(child, minidom.Element):
|
||||
continue
|
||||
if child.tagName != 'svg':
|
||||
continue
|
||||
mobjects = self.get_mobjects_from(child, dict())
|
||||
if self.unpack_groups:
|
||||
self.add(*mobjects)
|
||||
|
|
|
@ -85,6 +85,9 @@ class Text(SVGMobject):
|
|||
if self.height is None:
|
||||
self.scale(TEXT_MOB_SCALE_FACTOR)
|
||||
|
||||
def init_colors(self, override=True):
|
||||
super().init_colors(override=override)
|
||||
|
||||
def remove_empty_path(self, file_name):
|
||||
with open(file_name, 'r') as fpr:
|
||||
content = fpr.read()
|
||||
|
|
Loading…
Add table
Reference in a new issue