mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
commit
afbc624ac4
4 changed files with 9 additions and 9 deletions
|
@ -415,7 +415,7 @@ class Camera(object):
|
|||
if indices is None:
|
||||
ibo = None
|
||||
elif single_use:
|
||||
ibo = self.ctx.buffer(indices)
|
||||
ibo = self.ctx.buffer(indices.astype(np.uint32))
|
||||
else:
|
||||
# The vao.render call is strangely longer
|
||||
# when an index buffer is used, so if the
|
||||
|
|
|
@ -238,7 +238,7 @@ class Mobject(object):
|
|||
self.resize_points(0)
|
||||
|
||||
def get_num_points(self) -> int:
|
||||
return len(self.data["points"])
|
||||
return len(self.get_points())
|
||||
|
||||
def get_all_points(self) -> Vect3Array:
|
||||
if self.submobjects:
|
||||
|
@ -247,7 +247,7 @@ class Mobject(object):
|
|||
return self.get_points()
|
||||
|
||||
def has_points(self) -> bool:
|
||||
return self.data["points"].size > 0
|
||||
return len(self.get_points()) > 0
|
||||
|
||||
def get_bounding_box(self) -> Vect3Array:
|
||||
if self.needs_new_bounding_box:
|
||||
|
|
|
@ -111,12 +111,12 @@ class DecimalNumber(VMobject):
|
|||
num_string = num_string.replace("-", "–")
|
||||
return num_string
|
||||
|
||||
def init_data(self) -> None:
|
||||
super().init_data()
|
||||
self.data["font_size"] = np.array([self.font_size], dtype=float)
|
||||
def init_uniforms(self) -> None:
|
||||
super().init_uniforms()
|
||||
self.uniforms["font_size"] = self.font_size
|
||||
|
||||
def get_font_size(self) -> int:
|
||||
return int(self.data["font_size"][0])
|
||||
return int(self.uniforms["font_size"])
|
||||
|
||||
def get_formatter(self, **kwargs) -> str:
|
||||
"""
|
||||
|
@ -167,7 +167,7 @@ class DecimalNumber(VMobject):
|
|||
return self
|
||||
|
||||
def _handle_scale_side_effects(self, scale_factor: float) -> None:
|
||||
self.data["font_size"] *= scale_factor
|
||||
self.uniforms["font_size"] *= scale_factor
|
||||
|
||||
def get_value(self) -> float | complex:
|
||||
return self.number
|
||||
|
|
|
@ -720,7 +720,7 @@ class VMobject(Mobject):
|
|||
return bezier(self.get_nth_curve_points(n))
|
||||
|
||||
def get_num_curves(self) -> int:
|
||||
return len(self.data["points"]) // 2
|
||||
return self.get_num_points() // 2
|
||||
|
||||
def quick_point_from_proportion(self, alpha: float) -> Vect3:
|
||||
# Assumes all curves have the same length, so is inaccurate
|
||||
|
|
Loading…
Add table
Reference in a new issue