Skip to content

Commit 719c81d

Browse files
committed
Fix negative path_arc case
1 parent ed1fc4d commit 719c81d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

manimlib/mobject/geometry.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ def set_points_by_ends(self, start, end, buff=0, path_arc=0):
413413
self.set_points_as_corners([start, end])
414414
return self
415415
if path_arc:
416+
neg = path_arc < 0
417+
if neg:
418+
path_arc = -path_arc
419+
start, end = end, start
416420
radius = (dist / 2) / math.sin(path_arc / 2)
417421
alpha = (PI - path_arc) / 2
418422
center = start + radius * normalize(rotate_vector(end - start, alpha))
@@ -421,6 +425,8 @@ def set_points_by_ends(self, start, end, buff=0, path_arc=0):
421425
angle=path_arc - 2 * buff / radius,
422426
start_angle=angle_of_vector(start - center) + buff / radius,
423427
)
428+
if neg:
429+
raw_arc_points = raw_arc_points[::-1]
424430
self.set_points(center + radius * raw_arc_points)
425431
else:
426432
if buff > 0 and dist > 0:
@@ -585,7 +591,7 @@ def __init__(self, **kwargs):
585591
class Arrow(Line):
586592
CONFIG = {
587593
"stroke_color": GREY_A,
588-
"stroke_width": 10,
594+
"stroke_width": 5,
589595
"tip_width_ratio": 4,
590596
"width_to_tip_len": 0.0075,
591597
"max_tip_length_to_length_ratio": 0.3,

0 commit comments

Comments
 (0)