mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Fix arrow for new path behavior
This commit is contained in:
parent
5fac213fee
commit
6a18a05a3b
1 changed files with 4 additions and 6 deletions
|
@ -711,6 +711,7 @@ class Arrow(Line):
|
|||
else:
|
||||
alpha = tip_len / arc_len
|
||||
self.pointwise_become_partial(self, 0, 1 - alpha)
|
||||
self.start_new_path(self.get_points()[-1])
|
||||
self.add_line_to(prev_end)
|
||||
return self
|
||||
|
||||
|
@ -722,12 +723,9 @@ class Arrow(Line):
|
|||
self.max_width_to_length_ratio * self.get_length(),
|
||||
)
|
||||
widths_array = np.full(self.get_num_points(), width)
|
||||
nppc = self.n_points_per_curve
|
||||
if len(widths_array) > nppc:
|
||||
widths_array[-nppc:] = [
|
||||
a * self.tip_width_ratio * width
|
||||
for a in np.linspace(1, 0, nppc)
|
||||
]
|
||||
if len(widths_array) > 3:
|
||||
tip_width = self.tip_width_ratio * width
|
||||
widths_array[-3:] = tip_width * np.linspace(1, 0, 3)
|
||||
self.set_stroke(width=widths_array)
|
||||
return self
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue