File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
SDWebImageSwiftUI/Classes Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,10 @@ public struct AnimatedImage : ViewRepresentable {
73
73
74
74
func layoutView( _ view: AnimatedImageViewWrapper , context: ViewRepresentableContext < AnimatedImage > ) {
75
75
// AspectRatio
76
- if let aspectRatio = imageLayout. aspectRatio {
77
- // Not implements
76
+ if let _ = imageLayout. aspectRatio {
77
+ // TODO: Needs layer transform and geometry calculation
78
78
}
79
+
79
80
// ContentMode
80
81
switch imageLayout. contentMode {
81
82
case . fit:
@@ -91,6 +92,7 @@ public struct AnimatedImage : ViewRepresentable {
91
92
view. wrapped. contentMode = . scaleToFill
92
93
#endif
93
94
}
95
+
94
96
// RenderingMode
95
97
if let renderingMode = imageLayout. renderingMode {
96
98
switch renderingMode {
@@ -111,6 +113,7 @@ public struct AnimatedImage : ViewRepresentable {
111
113
break
112
114
}
113
115
}
116
+
114
117
// Interpolation
115
118
if let interpolation = imageLayout. interpolation {
116
119
switch interpolation {
@@ -129,15 +132,16 @@ public struct AnimatedImage : ViewRepresentable {
129
132
} else {
130
133
view. interpolationQuality = . default
131
134
}
135
+
132
136
// Antialiased
133
137
view. shouldAntialias = imageLayout. antialiased
134
138
135
139
// Display
136
140
#if os(macOS)
137
- view. updateConstraintsIfNeeded ( )
141
+ view. needsLayout = true
138
142
view. needsDisplay = true
139
143
#else
140
- view. updateConstraintsIfNeeded ( )
144
+ view. setNeedsLayout ( )
141
145
view. setNeedsDisplay ( )
142
146
#endif
143
147
}
You can’t perform that action at this time.
0 commit comments