Skip to content

Commit 01cd85a

Browse files
alembckebehacklpre-commit-ci[bot]
authored
Automatically remove long tick marks not within the range of the :class:~NumberLine (#1305)
* fix: when initializing NumberLine, check that numbers_with_elongated_ticks are on the number line * Update manim/mobject/number_line.py I agree with your suggested changes. Co-authored-by: Benjamin Hackl <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Benjamin Hackl <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 90a6aad commit 01cd85a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

manim/mobject/number_line.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def __init__(
5757
self.rotation = rotation
5858
self.tick_frequency = tick_frequency
5959
self.leftmost_tick = leftmost_tick
60-
self.numbers_with_elongated_ticks = numbers_with_elongated_ticks
6160
self.include_numbers = include_numbers
6261
self.numbers_to_show = numbers_to_show
6362
self.longer_tick_multiple = longer_tick_multiple
@@ -89,6 +88,12 @@ def __init__(
8988
self.unit_size = self.get_unit_size()
9089
self.shift(-self.number_to_point(self.number_at_center))
9190

91+
self.numbers_with_elongated_ticks = [
92+
nbr
93+
for nbr in numbers_with_elongated_ticks
94+
if self.x_min <= nbr <= self.x_max
95+
]
96+
9297
self.init_leftmost_tick()
9398
if self.include_tip:
9499
self.add_tip()

0 commit comments

Comments
 (0)