mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Change width_to_tip_len -> tip_len_to_width
This commit is contained in:
parent
ddf2f7d9bd
commit
fc522e5278
1 changed files with 3 additions and 3 deletions
|
@ -673,13 +673,13 @@ class Arrow(Line):
|
||||||
stroke_width: float = 5,
|
stroke_width: float = 5,
|
||||||
buff: float = 0.25,
|
buff: float = 0.25,
|
||||||
tip_width_ratio: float = 5,
|
tip_width_ratio: float = 5,
|
||||||
width_to_tip_len: float = 0.0075,
|
tip_len_to_width: float = 0.0075,
|
||||||
max_tip_length_to_length_ratio: float = 0.3,
|
max_tip_length_to_length_ratio: float = 0.3,
|
||||||
max_width_to_length_ratio: float = 8.0,
|
max_width_to_length_ratio: float = 8.0,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
self.tip_width_ratio = tip_width_ratio
|
self.tip_width_ratio = tip_width_ratio
|
||||||
self.width_to_tip_len = width_to_tip_len
|
self.tip_len_to_width = tip_len_to_width
|
||||||
self.max_tip_length_to_length_ratio = max_tip_length_to_length_ratio
|
self.max_tip_length_to_length_ratio = max_tip_length_to_length_ratio
|
||||||
self.max_width_to_length_ratio = max_width_to_length_ratio
|
self.max_width_to_length_ratio = max_width_to_length_ratio
|
||||||
super().__init__(
|
super().__init__(
|
||||||
|
@ -705,8 +705,8 @@ class Arrow(Line):
|
||||||
def insert_tip_anchor(self) -> Self:
|
def insert_tip_anchor(self) -> Self:
|
||||||
prev_end = self.get_end()
|
prev_end = self.get_end()
|
||||||
arc_len = self.get_arc_length()
|
arc_len = self.get_arc_length()
|
||||||
tip_len = self.get_stroke_width() * self.width_to_tip_len * self.tip_width_ratio
|
|
||||||
if tip_len >= self.max_tip_length_to_length_ratio * arc_len:
|
if tip_len >= self.max_tip_length_to_length_ratio * arc_len:
|
||||||
|
tip_len = self.get_stroke_width() * self.tip_width_ratio * self.tip_len_to_width
|
||||||
alpha = self.max_tip_length_to_length_ratio
|
alpha = self.max_tip_length_to_length_ratio
|
||||||
else:
|
else:
|
||||||
alpha = tip_len / arc_len
|
alpha = tip_len / arc_len
|
||||||
|
|
Loading…
Add table
Reference in a new issue