Skip to content

Commit

Permalink
Fix a potential bug using height or width in Text
Browse files Browse the repository at this point in the history
  • Loading branch information
xy-23 committed May 7, 2020
1 parent 936c33f commit 55bf779
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manimlib/mobject/svg/text_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, text, **config):
self.remove_last_M(file_name)
SVGMobject.__init__(self, file_name, **config)
self.apply_space_chars()
self.move_into_position()
self.move_to(ORIGIN)

nppc = self.n_points_per_cubic_curve
for each in self:
Expand All @@ -84,7 +84,8 @@ def __init__(self, text, **config):
self.set_color_by_t2g()

# anti-aliasing
self.scale(TEXT_MOB_SCALE_FACTOR)
if self.height is None and self.width is None:
self.scale(TEXT_MOB_SCALE_FACTOR)

def apply_space_chars(self):
indexes = self.find_indexes(' ') + self.find_indexes('\n')
Expand Down

0 comments on commit 55bf779

Please sign in to comment.