Merge pull request #1649 from 3b1b/quintic

Small tweaks
This commit is contained in:
Grant Sanderson 2021-10-15 12:10:18 -07:00 committed by GitHub
commit e9aba0b92c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -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

View file

@ -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 = {