mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Add scale_factor parameter to BulletedList.fade_all_but
This commit is contained in:
parent
ac3c5b8380
commit
bcfd48d951
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,7 @@ class BulletedList(VGroup):
|
|||
buff: float = MED_LARGE_BUFF,
|
||||
aligned_edge: Vect3 = LEFT,
|
||||
**kwargs
|
||||
):
|
||||
):
|
||||
labelled_content = [R"\item " + item for item in items]
|
||||
tex_string = "\n".join([
|
||||
R"\begin{itemize}",
|
||||
|
@ -36,9 +36,12 @@ class BulletedList(VGroup):
|
|||
|
||||
self.arrange(DOWN, buff=buff, aligned_edge=aligned_edge)
|
||||
|
||||
def fade_all_but(self, index: int, opacity: float = 0.25) -> None:
|
||||
def fade_all_but(self, index: int, opacity: float = 0.25, scale_factor=0.7) -> None:
|
||||
max_dot_height = max([item[0].get_height() for item in self.submobjects])
|
||||
for i, part in enumerate(self.submobjects):
|
||||
trg_dot_height = (1.0 if i == index else scale_factor) * max_dot_height
|
||||
part.set_fill(opacity=(1.0 if i == index else opacity))
|
||||
part.scale(trg_dot_height / part[0].get_height(), about_edge=LEFT)
|
||||
|
||||
|
||||
class TexTextFromPresetString(TexText):
|
||||
|
|
Loading…
Add table
Reference in a new issue