From c41810d7cf995c02876ccfa59a795a59bc02cabf Mon Sep 17 00:00:00 2001 From: jimmy-to-goldenowl Date: Thu, 7 Nov 2024 10:17:20 +0700 Subject: [PATCH 1/3] fix --- Sources/Instructions/Core/Public/CoachMark.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Instructions/Core/Public/CoachMark.swift b/Sources/Instructions/Core/Public/CoachMark.swift index 00e8a894..1998ce14 100644 --- a/Sources/Instructions/Core/Public/CoachMark.swift +++ b/Sources/Instructions/Core/Public/CoachMark.swift @@ -83,7 +83,7 @@ public struct CoachMark { return } - if cutoutPath.bounds.origin.y > frame.size.height / 2 { + if (cutoutPath.bounds.origin.y + cutoutPath.bounds.height) > frame.size.height / 2 { self.arrowOrientation = .bottom } else { self.arrowOrientation = .top From 401f4200be1391bfc4c9de25402be4301bf18884 Mon Sep 17 00:00:00 2001 From: jimmy-to-goldenowl Date: Thu, 7 Nov 2024 10:50:10 +0700 Subject: [PATCH 2/3] fix: fix computeOrientation --- Sources/Instructions/Core/Public/CoachMark.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Instructions/Core/Public/CoachMark.swift b/Sources/Instructions/Core/Public/CoachMark.swift index 1998ce14..d0e1f3cc 100644 --- a/Sources/Instructions/Core/Public/CoachMark.swift +++ b/Sources/Instructions/Core/Public/CoachMark.swift @@ -83,7 +83,7 @@ public struct CoachMark { return } - if (cutoutPath.bounds.origin.y + cutoutPath.bounds.height) > frame.size.height / 2 { + if (cutoutPath.bounds.origin.y + cutoutPath.bounds.height) > (frame.size.height - 300) { self.arrowOrientation = .bottom } else { self.arrowOrientation = .top From 9ce9ae68090512cc65a73fa97ebd5b7dd0dec45e Mon Sep 17 00:00:00 2001 From: jimmy-to-goldenowl Date: Fri, 8 Nov 2024 08:58:36 +0700 Subject: [PATCH 3/3] fix: computeOrientation --- Sources/Instructions/Core/Public/CoachMark.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Instructions/Core/Public/CoachMark.swift b/Sources/Instructions/Core/Public/CoachMark.swift index d0e1f3cc..008b14b5 100644 --- a/Sources/Instructions/Core/Public/CoachMark.swift +++ b/Sources/Instructions/Core/Public/CoachMark.swift @@ -83,7 +83,9 @@ public struct CoachMark { return } - if (cutoutPath.bounds.origin.y + cutoutPath.bounds.height) > (frame.size.height - 300) { + let top = cutoutPath.bounds.origin.y + let bottom = frame.size.height - cutoutPath.bounds.origin.y - cutoutPath.bounds.height + if top > bottom { self.arrowOrientation = .bottom } else { self.arrowOrientation = .top