Skip to content

Commit

Permalink
Update StyleModifier (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii authored Nov 22, 2023
1 parent f4c55f2 commit a6b6c98
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit a6b6c98

Please sign in to comment.