Skip to content

Commit

Permalink
Move masking after view sizing (#4675)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdholtz authored Jan 15, 2025
1 parent e28f028 commit 4536ebc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ struct ImageComponentView: View {
}
.size(style.size)
.clipped()
.shape(border: nil,
shape: style.shape)
.padding(style.padding)
// WIP: Add border still
.padding(style.margin)
}
}

Expand Down Expand Up @@ -89,11 +94,6 @@ struct ImageComponentView: View {
Color.clear.backgroundStyle(.color(colorOverlay))
)
})
.shape(border: nil,
shape: style.shape)
.padding(style.padding)
// WIP: Add border still
.padding(style.margin)
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ private enum Template1Preview {
heicLowRes: catUrl
)
),
fitMode: .fit,
size: .init(width: .fill, height: .fixed(270)),
fitMode: .fill,
maskShape: .convex
)

Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/Templates/V2/ViewHelpers/Shape.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private struct ConvexShape: Shape {

private var curveHeight: CGFloat {
// Calculate the curve height as a percentage of the view's height
max(0, size.height * curveHeightPercentage)
max(0, size.height * curveHeightPercentage) / 2
}

}
Expand Down

0 comments on commit 4536ebc

Please sign in to comment.