Skip to content
Merged
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
8 changes: 6 additions & 2 deletions Sources/SwiftUISupport/Components/StyleModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ public struct StyleModifier: ViewModifier {
public let scale: CGSize
public let offset: CGSize
public let blurRadius: Double

public let rotationEffect: Angle

public init(
opacity: Double = 1,
scale: CGSize = .init(width: 1, height: 1),
offset: CGSize = .zero,
blurRadius: Double = 0
blurRadius: Double = 0,
rotationEffect: Angle = .zero
) {
self.opacity = opacity
self.scale = scale
self.offset = offset
self.blurRadius = blurRadius
self.rotationEffect = rotationEffect
}

public func body(content: Content) -> some View {
Expand All @@ -27,6 +30,7 @@ public struct StyleModifier: ViewModifier {
.opacity(opacity)
.scaleEffect(scale)
.blur(radius: blurRadius)
.rotationEffect(rotationEffect)
}

public static var identity: Self {
Expand Down