mirror of
https://github.com/3b1b/manim.git
synced 2025-04-13 09:47:07 +00:00
removing 1 in neg axis if unit_tex is specified
This commit is contained in:
parent
7a7bf83f11
commit
7706a8bfb5
1 changed files with 6 additions and 2 deletions
|
@ -182,9 +182,13 @@ class NumberLine(Line):
|
||||||
if x < 0 and direction[0] == 0:
|
if x < 0 and direction[0] == 0:
|
||||||
# Align without the minus sign
|
# Align without the minus sign
|
||||||
num_mob.shift(num_mob[0].get_width() * LEFT / 2)
|
num_mob.shift(num_mob[0].get_width() * LEFT / 2)
|
||||||
if x == unit and unit_tex:
|
if abs(x) == unit and unit_tex:
|
||||||
center = num_mob.get_center()
|
center = num_mob.get_center()
|
||||||
num_mob.remove(num_mob[0])
|
if x > 0:
|
||||||
|
num_mob.remove(num_mob[0])
|
||||||
|
else:
|
||||||
|
num_mob.remove(num_mob[1])
|
||||||
|
num_mob[0].next_to(num_mob[1], LEFT, buff=num_mob[0].get_width() / 4)
|
||||||
num_mob.move_to(center)
|
num_mob.move_to(center)
|
||||||
return num_mob
|
return num_mob
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue