Skip to content

Commit e0d5852

Browse files
authored
Enables antialias (#24)
1 parent 53d3ac4 commit e0d5852

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

Sources/AsyncMultiplexImage-Nuke/AsyncMultiplexImageNuke.swift

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public struct AsyncMultiplexImageNuke: View {
2727
image
2828
.resizable()
2929
.scaledToFill()
30-
.transition(.opacity.animation(.bouncy))
30+
.transition(.opacity.animation(.bouncy))
3131
case .failure:
3232
EmptyView()
3333
}
@@ -50,6 +50,55 @@ public struct AsyncMultiplexImageNuke: View {
5050
)
5151
}
5252

53+
#Preview("Rotating") {
54+
HStack {
55+
56+
Rectangle()
57+
.frame(width: 100, height: 100)
58+
.rotationEffect(.degrees(10))
59+
60+
AsyncMultiplexImageNuke(
61+
imageRepresentation: .remote(
62+
.init(
63+
constant: URL(
64+
string:
65+
"https://images.unsplash.com/photo-1492446845049-9c50cc313f00?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8"
66+
)!
67+
)
68+
)
69+
)
70+
.frame(width: 100, height: 100)
71+
.rotationEffect(.degrees(10))
72+
.clipped(antialiased: true)
73+
74+
AsyncMultiplexImageNuke(
75+
imageRepresentation: .remote(
76+
.init(
77+
constant: URL(
78+
string:
79+
"https://images.unsplash.com/photo-1492446845049-9c50cc313f00?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8"
80+
)!
81+
)
82+
)
83+
)
84+
.frame(width: 100, height: 100)
85+
.rotationEffect(.degrees(20))
86+
87+
AsyncMultiplexImageNuke(
88+
imageRepresentation: .remote(
89+
.init(
90+
constant: URL(
91+
string:
92+
"https://images.unsplash.com/photo-1492446845049-9c50cc313f00?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8"
93+
)!
94+
)
95+
)
96+
)
97+
.frame(width: 100, height: 100)
98+
.rotationEffect(.degrees(30))
99+
}
100+
}
101+
53102
#Preview {
54103
AsyncMultiplexImageNuke(
55104
imageRepresentation: .loaded(Image(systemName: "photo"))

Sources/AsyncMultiplexImage/AsyncMultiplexImage.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private struct _AsyncMultiplexImage<Content: View, Downloader: AsyncMultiplexIma
291291

292292
}
293293
)
294-
.clipped()
294+
.clipped(antialiased: true)
295295

296296
}
297297
}

0 commit comments

Comments
 (0)