mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
allow Mobject.scale receive iterable scale_factor
This commit is contained in:
parent
f4eb2724c5
commit
1658438fef
1 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,7 @@ import random
|
|||
import sys
|
||||
import moderngl
|
||||
from functools import wraps
|
||||
from collections import Iterable
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -596,7 +597,10 @@ class Mobject(object):
|
|||
Otherwise, if about_point is given a value, scaling is done with
|
||||
respect to that point.
|
||||
"""
|
||||
scale_factor = max(scale_factor, min_scale_factor)
|
||||
if isinstance(scale_factor, Iterable):
|
||||
scale_factor = np.array(scale_factor).clip(min=min_scale_factor)
|
||||
else:
|
||||
scale_factor = max(scale_factor, min_scale_factor)
|
||||
self.apply_points_function(
|
||||
lambda points: scale_factor * points,
|
||||
about_point=about_point,
|
||||
|
|
Loading…
Add table
Reference in a new issue