mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Fix pfp for null curves
This commit is contained in:
parent
217eb6b486
commit
1f8ad5be16
1 changed files with 2 additions and 0 deletions
|
@ -766,6 +766,8 @@ class VMobject(Mobject):
|
||||||
def quick_point_from_proportion(self, alpha: float) -> Vect3:
|
def quick_point_from_proportion(self, alpha: float) -> Vect3:
|
||||||
# Assumes all curves have the same length, so is inaccurate
|
# Assumes all curves have the same length, so is inaccurate
|
||||||
num_curves = self.get_num_curves()
|
num_curves = self.get_num_curves()
|
||||||
|
if num_curves == 0:
|
||||||
|
return self.get_center()
|
||||||
n, residue = integer_interpolate(0, num_curves, alpha)
|
n, residue = integer_interpolate(0, num_curves, alpha)
|
||||||
curve_func = self.get_nth_curve_function(n)
|
curve_func = self.get_nth_curve_function(n)
|
||||||
return curve_func(residue)
|
return curve_func(residue)
|
||||||
|
|
Loading…
Add table
Reference in a new issue