From a6b6c987cdf60ab796254f2557234dbac8e53429 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Wed, 22 Nov 2023 21:56:23 +0900 Subject: [PATCH] Update StyleModifier (#37) --- Sources/SwiftUISupport/Components/StyleModifier.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftUISupport/Components/StyleModifier.swift b/Sources/SwiftUISupport/Components/StyleModifier.swift index 441e7d205f..c3bd05feda 100644 --- a/Sources/SwiftUISupport/Components/StyleModifier.swift +++ b/Sources/SwiftUISupport/Components/StyleModifier.swift @@ -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 { @@ -27,6 +30,7 @@ public struct StyleModifier: ViewModifier { .opacity(opacity) .scaleEffect(scale) .blur(radius: blurRadius) + .rotationEffect(rotationEffect) } public static var identity: Self {