mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
If replacing a null mobject, just scale by 0
This commit is contained in:
parent
5939f24cd4
commit
c2b5595fae
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@ import operator as op
|
||||||
import random
|
import random
|
||||||
import sys
|
import sys
|
||||||
import moderngl
|
import moderngl
|
||||||
|
import logging
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
@ -580,7 +581,7 @@ class Mobject(object):
|
||||||
|
|
||||||
def replace(self, mobject, dim_to_match=0, stretch=False):
|
def replace(self, mobject, dim_to_match=0, stretch=False):
|
||||||
if not mobject.get_num_points() and not mobject.submobjects:
|
if not mobject.get_num_points() and not mobject.submobjects:
|
||||||
raise Warning("Attempting to replace mobject with no points")
|
self.scale(0)
|
||||||
return self
|
return self
|
||||||
if stretch:
|
if stretch:
|
||||||
for i in range(self.dim):
|
for i in range(self.dim):
|
||||||
|
|
Loading…
Add table
Reference in a new issue