mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
commit
e9aba0b92c
2 changed files with 12 additions and 3 deletions
|
@ -532,8 +532,14 @@ class ComplexPlane(NumberPlane):
|
||||||
value = z.real
|
value = z.real
|
||||||
number_mob = axis.get_number_mobject(value, **kwargs)
|
number_mob = axis.get_number_mobject(value, **kwargs)
|
||||||
# For i and -i, remove the "1"
|
# For i and -i, remove the "1"
|
||||||
if abs(z.imag) == 1:
|
if z.imag == 1:
|
||||||
number_mob.remove(number_mob[0])
|
number_mob.remove(number_mob[0])
|
||||||
|
if z.imag == -1:
|
||||||
|
number_mob.remove(number_mob[1])
|
||||||
|
number_mob[0].next_to(
|
||||||
|
number_mob[1], LEFT,
|
||||||
|
buff=number_mob[0].get_width() / 4
|
||||||
|
)
|
||||||
self.coordinate_labels.add(number_mob)
|
self.coordinate_labels.add(number_mob)
|
||||||
self.add(self.coordinate_labels)
|
self.add(self.coordinate_labels)
|
||||||
return self
|
return self
|
||||||
|
|
|
@ -22,10 +22,13 @@ class ImageMobject(Mobject):
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, filename, **kwargs):
|
def __init__(self, filename, **kwargs):
|
||||||
path = get_full_raster_image_path(filename)
|
self.set_image_path(get_full_raster_image_path(filename))
|
||||||
|
super().__init__(**kwargs)
|
||||||
|
|
||||||
|
def set_image_path(self, path):
|
||||||
|
self.path = path
|
||||||
self.image = Image.open(path)
|
self.image = Image.open(path)
|
||||||
self.texture_paths = {"Texture": path}
|
self.texture_paths = {"Texture": path}
|
||||||
super().__init__(**kwargs)
|
|
||||||
|
|
||||||
def init_data(self):
|
def init_data(self):
|
||||||
self.data = {
|
self.data = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue