From f6f365b7cdfd3d19ff11cb3810f8966c89c9565f Mon Sep 17 00:00:00 2001 From: Josh Holtz Date: Thu, 12 Dec 2024 11:18:37 -0600 Subject: [PATCH] Fix some border math for overlapping borders (#4523) --- RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift | 12 +++++++----- .../UI/Views/OfferingList/APIKeyDashboardList.swift | 7 +++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift b/RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift index 590c68cae8..9c1836b72d 100644 --- a/RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift +++ b/RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift @@ -194,6 +194,8 @@ private struct BorderRoundedCornerShape: Shape { func path(in rect: CGRect) -> Path { var path = Path() + let maxY = rect.maxY - 1 + // Start from the top-left corner path.move(to: CGPoint(x: rect.minX + topLeft, y: rect.minY)) @@ -203,13 +205,13 @@ private struct BorderRoundedCornerShape: Shape { control: CGPoint(x: rect.maxX, y: rect.minY)) // Right edge and bottom-right corner - path.addLine(to: CGPoint(x: rect.maxX, y: rect.maxY - bottomRight)) - path.addQuadCurve(to: CGPoint(x: rect.maxX - bottomRight, y: rect.maxY), - control: CGPoint(x: rect.maxX, y: rect.maxY)) + path.addLine(to: CGPoint(x: rect.maxX, y: maxY - bottomRight)) + path.addQuadCurve(to: CGPoint(x: rect.maxX - bottomRight, y: maxY), + control: CGPoint(x: rect.maxX, y: maxY)) // Bottom edge and bottom-left corner - path.addLine(to: CGPoint(x: rect.minX + bottomLeft, y: rect.maxY)) - path.addQuadCurve(to: CGPoint(x: rect.minX, y: rect.maxY - bottomLeft), + path.addLine(to: CGPoint(x: rect.minX + bottomLeft, y: maxY)) + path.addQuadCurve(to: CGPoint(x: rect.minX, y: maxY - bottomLeft), control: CGPoint(x: rect.minX, y: rect.maxY)) // Left edge and top-left corner diff --git a/Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/OfferingList/APIKeyDashboardList.swift b/Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/OfferingList/APIKeyDashboardList.swift index 638be41531..35cd4dfc1a 100644 --- a/Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/OfferingList/APIKeyDashboardList.swift +++ b/Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/OfferingList/APIKeyDashboardList.swift @@ -181,6 +181,13 @@ struct APIKeyDashboardList: View { .onRestoreCompleted { _ in self.presentedPaywall = nil } + #if PAYWALL_COMPONENTS + .onAppear { + if let errorInfo = paywall.offering.paywallComponentsData?.errorInfo { + print("Paywall V2 Error:", errorInfo.debugDescription) + } + } + #endif } }