spacing on shapes and text

This commit is contained in:
Trey t
2022-03-20 14:43:25 -05:00
parent 36a688084c
commit e226437e50
5 changed files with 79 additions and 39 deletions

View File

@@ -25,7 +25,16 @@ enum BGShape: Int, CaseIterable {
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .diamond:
Diamond()
.fill(bgColor)
@@ -34,7 +43,16 @@ enum BGShape: Int, CaseIterable {
minHeight: 5,
maxHeight: 500)
.aspectRatio(contentMode: .fit)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .rectangle:
Rectangle()
.fill(bgColor)
@@ -43,6 +61,16 @@ enum BGShape: Int, CaseIterable {
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
case .roundedRectangle:
RoundedRectangle(cornerRadius: 8, style: .continuous)
.fill(bgColor)
@@ -51,15 +79,17 @@ enum BGShape: Int, CaseIterable {
minHeight: 5,
maxHeight: 500,
alignment: .center)
.overlay(
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.2)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
)
}
text
.font(.title2)
.fontWeight(.bold)
.lineLimit(1)
.foregroundColor(textColor)
.minimumScaleFactor(0.7)
.padding(10)
.frame(maxWidth: .infinity, alignment: .center)
})
}
}