Skip to content

Commit

Permalink
Fix some border math for overlapping borders (#4523)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz authored Dec 12, 2024
1 parent 5812126 commit f6f365b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 7 additions & 5 deletions RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit f6f365b

Please sign in to comment.