Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Sources/ShapeUp/Emboss/EmbossViewModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,49 +29,49 @@ struct EmbossViewModifier: ViewModifier {
func body(content: Content) -> some View {
content
.opacity(baseColor == nil ? 1 : 0)
.overlay(
.overlay {
ZStack {
baseColor

Color.white
.accessibilityIgnoresInvertColors()
.mask(
.mask {
Color.white
.overlay(
.overlay {
Color.black
.mask(
.mask {
content
.offset(x: offsetX, y: offsetY)
)
)
}
}
.blur(radius: blur)
.drawingGroup()
.luminanceToAlpha()
)
}
.opacity(opacity)
.allowsHitTesting(false)
.accessibility(hidden: true)
.accessibilityHidden(true)

Color.black
.accessibilityIgnoresInvertColors()
.mask(
.mask {
Color.white
.overlay(
.overlay {
Color.black
.mask(
.mask {
content
.offset(x: -offsetX, y: -offsetY)
)
)
}
}
.blur(radius: blur)
.drawingGroup()
.luminanceToAlpha()
)
}
.opacity(opacity)
.allowsHitTesting(false)
.accessibility(hidden: true)
.accessibilityHidden(true)
}
)
.mask(content)
}
.mask { content }
}
}
2 changes: 1 addition & 1 deletion Sources/ShapeUp/Rect/CGFrame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public extension CGFrameRepresentable {


/// A coordinate frame defined by an origin and a vector for each axis.
public struct CGFrame: CGFrameRepresentable {
public struct CGFrame: CGFrameRepresentable, Sendable {
/// The origin point of the coordinate frame.
public var origin: CGPoint
/// The vector defining the x-axis direction and magnitude.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public extension InsettableShape {

return self
.fill(backgroundColor)
.overlay(
.overlay {
ZStack {
self
.inset(by: inset)
Expand All @@ -43,7 +43,7 @@ public extension InsettableShape {
.accessibilityIgnoresInvertColors()
.clipShape(self)
.blendMode(.overlay)
)
}
}

/// Returns a view with debossed edges that matches the parent shape.
Expand Down
8 changes: 4 additions & 4 deletions Sources/ShapeUp/_Extension-Public/View+publicExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public extension View {
/// - Returns: The same view with an overlayed embossed effect using edges of a supplied shape.
func emboss<S>(using shape: S, size: CGFloat, angle: Angle? = nil, opacity: Double? = nil) -> some View where S : InsettableShape {
self
.overlay(
.overlay {
shape
.embossEdges(size: size, angle: angle, opacity: opacity)
.allowsHitTesting(false)
)
}
}

/// Returns the same view with an overlayed debossed effect using edges of a supplied shape.
Expand All @@ -41,11 +41,11 @@ public extension View {
/// - Returns: The same view with an overlayed debossed effect using edges of a supplied shape.
func deboss<S>(using shape: S, size: CGFloat, angle: Angle? = nil, opacity: Double? = nil) -> some View where S : InsettableShape {
self
.overlay(
.overlay {
shape
.debossEdges(size: size, angle: angle, opacity: opacity)
.allowsHitTesting(false)
)
}
}

/// Returns the same view with an overlayed embossed effect.
Expand Down
Loading