Skip to content

Commit b55dd5b

Browse files
committed
Simplify usage of frame modifiers
1 parent 3b4c9e2 commit b55dd5b

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

Sources/MarkdownUI/Views/Inlines/ImageView.swift

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ private struct ImageViewFrameModifier: ViewModifier {
106106
let size: MarkdownImageSize?
107107

108108
func body(content: Content) -> some View {
109-
if let size {
110-
if let width = size.width, let height = size.height {
111-
content.frame(width: width, height: height)
112-
} else if let width = size.width, size.height == nil {
113-
content.frame(width: width)
114-
} else if let height = size.height, size.width == nil {
115-
content.frame(height: height)
116-
} else {
117-
content
118-
}
119-
} else {
120-
content
121-
}
109+
content.frame(width: size?.width, height: size?.height)
122110
}
123111
}

0 commit comments

Comments
 (0)