@@ -16,9 +16,9 @@ public struct Illustration: View {
16
16
public var body : some View {
17
17
if name. isEmpty == false {
18
18
switch layout {
19
- case . frame( let maxHeight , let alignment) :
19
+ case . frame( let height , let alignment) :
20
20
resizeableImage
21
- . frame ( maxHeight : maxHeight )
21
+ . frame ( height : height )
22
22
. frame ( maxWidth: idealSize. horizontal == true ? nil : . infinity, alignment: . init( alignment) )
23
23
. fixedSize ( horizontal: false , vertical: true )
24
24
case . resizeable:
@@ -82,12 +82,12 @@ public extension Illustration {
82
82
/// Illustration layout specifies how the illustration is resized and (optionally) horizontally aligned.
83
83
enum Layout {
84
84
85
- /// Default maximal illustration height using frame layout.
86
- public static let maxHeight : CGFloat = 200
85
+ /// Default illustration height when using frame layout.
86
+ public static let height : CGFloat = 200
87
87
88
- /// Positions illustration, first scaled to fit the optional maxHeight , in a horizontally expanding frame with specified alignment.
88
+ /// Positions illustration, first scaled to fit the height , in a horizontally expanding frame with specified alignment.
89
89
case frame(
90
- maxHeight : CGFloat = maxHeight ,
90
+ height : CGFloat = height ,
91
91
alignment: HorizontalAlignment = . center
92
92
)
93
93
/// Applies `resizable` and `scaledToFit` modifiers to allow free resizing.
@@ -125,7 +125,7 @@ struct IllustrationPreviews: PreviewProvider {
125
125
}
126
126
127
127
static var customResource : some View {
128
- Illustration ( " WomanWithPhone " , bundle: . orbit , layout: . intrinsic)
128
+ Illustration ( " WomanWithPhone " , bundle: . orbitIllustrations , layout: . intrinsic)
129
129
. previewDisplayName ( )
130
130
}
131
131
@@ -148,22 +148,22 @@ struct IllustrationPreviews: PreviewProvider {
148
148
. border ( . cloudNormal)
149
149
}
150
150
151
- Card ( " MaxHeight = 80" , showBorder: false ) {
151
+ Card ( " Height = 80" , showBorder: false ) {
152
152
VStack {
153
153
Text ( " Frame - Center (default) " )
154
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 80 ) )
154
+ Illustration ( . womanWithPhone, layout: . frame( height : 80 ) )
155
155
. border ( . cloudNormal)
156
156
}
157
157
158
158
VStack {
159
159
Text ( " Frame - Leading " )
160
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 80 , alignment: . leading) )
160
+ Illustration ( . womanWithPhone, layout: . frame( height : 80 , alignment: . leading) )
161
161
. border ( . cloudNormal)
162
162
}
163
163
164
164
VStack {
165
165
Text ( " Frame - Trailing " )
166
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 80 , alignment: . trailing) )
166
+ Illustration ( . womanWithPhone, layout: . frame( height : 80 , alignment: . trailing) )
167
167
. border ( . cloudNormal)
168
168
}
169
169
@@ -175,17 +175,17 @@ struct IllustrationPreviews: PreviewProvider {
175
175
}
176
176
}
177
177
178
- Card ( " MaxHeight = 30" , showBorder: false ) {
178
+ Card ( " Height = 30" , showBorder: false ) {
179
179
HStack {
180
180
VStack ( alignment: . leading) {
181
181
Text ( " Leading " )
182
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 30 , alignment: . leading) )
182
+ Illustration ( . womanWithPhone, layout: . frame( height : 30 , alignment: . leading) )
183
183
. border ( . cloudNormal)
184
184
}
185
185
186
186
VStack ( alignment: . leading) {
187
187
Text ( " Center " )
188
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 30 ) )
188
+ Illustration ( . womanWithPhone, layout: . frame( height : 30 ) )
189
189
. border ( . cloudNormal)
190
190
}
191
191
@@ -198,7 +198,7 @@ struct IllustrationPreviews: PreviewProvider {
198
198
199
199
VStack ( alignment: . leading) {
200
200
Text ( " Trailing " )
201
- Illustration ( . womanWithPhone, layout: . frame( maxHeight : 30 , alignment: . trailing) )
201
+ Illustration ( . womanWithPhone, layout: . frame( height : 30 , alignment: . trailing) )
202
202
. border ( . cloudNormal)
203
203
}
204
204
}
0 commit comments