Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed wrong cell coordinates with `:meth:~.Table.get_cell` after scaling. (#2262)

Laith Bahodie389ec8b5870
diff --git a/manim/mobject/table.py b/manim/mobject/table.py
index ecb84c18b..6e19bccb4 100644
--- a/manim/mobject/table.py
+++ b/manim/mobject/table.py
@@ -960,6 +960,14 @@ class Table(VGroup):
]
return AnimationGroup(*animations, lag_ratio=lag_ratio)
+ def scale(self, scale_factor: float, **kwargs):
+ # h_buff and v_buff must be adjusted so that Table.get_cell
+ # can construct an accurate polygon for a cell.
+ self.h_buff *= scale_factor
+ self.v_buff *= scale_factor
+ super().scale(scale_factor, **kwargs)
+ return self
+
class MathTable(Table):
"""A specialized :class:`~.Table` mobject for use with with LaTeX.