Skip to content

Commit

Permalink
Fix match_style
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Oct 3, 2021
1 parent 9483f26 commit 5f878a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manimlib/mobject/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_complex_formatter(self, **kwargs):

def set_value(self, number):
move_to_point = self.get_edge_center(self.edge_to_fix)
old_submobjects = self.submobjects
old_submobjects = list(self.submobjects)
self.set_submobjects_from_number(number)
self.move_to(move_to_point, self.edge_to_fix)
for sm1, sm2 in zip(self.submobjects, old_submobjects):
Expand Down
8 changes: 7 additions & 1 deletion manimlib/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def set_style(self,
stroke_opacity=None,
stroke_rgba=None,
stroke_width=None,
stroke_background=True,
gloss=None,
shadow=None,
recurse=True):
Expand All @@ -163,13 +164,17 @@ def set_style(self,

if stroke_rgba is not None:
self.data['stroke_rgba'] = resize_with_interpolation(stroke_rgba, len(fill_rgba))
self.set_stroke(width=stroke_width)
self.set_stroke(
width=stroke_width,
background=stroke_background,
)
else:
self.set_stroke(
color=stroke_color,
width=stroke_width,
opacity=stroke_opacity,
recurse=recurse,
background=stroke_background,
)

if gloss is not None:
Expand All @@ -183,6 +188,7 @@ def get_style(self):
"fill_rgba": self.data['fill_rgba'],
"stroke_rgba": self.data['stroke_rgba'],
"stroke_width": self.data['stroke_width'],
"stroke_background": self.draw_stroke_behind_fill,
"gloss": self.get_gloss(),
"shadow": self.get_shadow(),
}
Expand Down

0 comments on commit 5f878a2

Please sign in to comment.