示例#1
0
def test_chained_animate():
    s = Square()
    scale_factor = 2
    direction = np.array((1, 1, 0))
    anim = s.animate.scale(scale_factor).shift(direction).build()
    assert (anim.mobject.target.get_width() == scale_factor * s.get_width()
            and (anim.mobject.target.get_center() == direction).all())
示例#2
0
def test_simple_animate():
    s = Square()
    scale_factor = 2
    anim = s.animate.scale(scale_factor).build()
    assert anim.mobject.target.get_width() == scale_factor * s.get_width()