re-do the way a custom icon is generated / stored
fix small roll up header text going outside of circle view
This commit is contained in:
@@ -57,8 +57,8 @@ struct IconView: View {
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
|
||||
LazyVGrid(columns: columns, alignment: .leading, spacing: 0) {
|
||||
ForEach(customIcon.background, id: \.self.1) { (image, uuid) in
|
||||
image
|
||||
ForEach(customIcon.background, id: \.self.1) { (bgOption, uuid) in
|
||||
bgOption.image
|
||||
.resizable()
|
||||
.aspectRatio(1, contentMode: .fill)
|
||||
.foregroundColor(customIcon.bgOverlayColor)
|
||||
@@ -68,7 +68,7 @@ struct IconView: View {
|
||||
.background(
|
||||
.clear
|
||||
)
|
||||
|
||||
|
||||
Circle()
|
||||
.strokeBorder(customIcon.circleStrokeColor, lineWidth: geo.size.width * 0.045)
|
||||
.background(Circle().fill(customIcon.innerColor))
|
||||
@@ -76,8 +76,8 @@ struct IconView: View {
|
||||
height: geo.size.height*facePercSize,
|
||||
alignment: .center)
|
||||
.position(x: geo.size.width/2, y: geo.size.height/2)
|
||||
|
||||
customIcon.leftEye
|
||||
|
||||
customIcon.leftEye.image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: geo.size.width*0.12,
|
||||
@@ -86,8 +86,8 @@ struct IconView: View {
|
||||
.position(x: geo.size.width*0.4,
|
||||
y: geo.size.height*0.4)
|
||||
.foregroundColor(customIcon.leftEyeColor)
|
||||
|
||||
customIcon.rightEye
|
||||
|
||||
customIcon.rightEye.image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: geo.size.width*0.12,
|
||||
@@ -96,8 +96,8 @@ struct IconView: View {
|
||||
.position(x: geo.size.width*0.6,
|
||||
y: geo.size.height*0.4)
|
||||
.foregroundColor(customIcon.rightEyeColor)
|
||||
|
||||
customIcon.mouth
|
||||
|
||||
customIcon.mouth.image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: geo.size.width*0.12,
|
||||
@@ -114,27 +114,16 @@ struct IconView: View {
|
||||
}
|
||||
|
||||
struct IconView_Previews: PreviewProvider {
|
||||
static var backgrounds: [(Image, UUID)] = {
|
||||
var blah = [(Image, UUID)]()
|
||||
static var backgrounds: [(BackGroundOptions, UUID)] = {
|
||||
var blah = [(BackGroundOptions, UUID)]()
|
||||
for _ in 0...CustomIcon.numberOfBGItems {
|
||||
let image = Image(BackGroundOptions.selectable.randomElement()!.rawValue, bundle: .main)
|
||||
blah.append((image, UUID()))
|
||||
blah.append((BackGroundOptions.selectable.randomElement()!, UUID()))
|
||||
}
|
||||
return blah
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
IconView(customIcon: CustomIcon(leftEye: EyeOptions.defaultOption,
|
||||
rightEye: EyeOptions.defaultOption,
|
||||
mouth: MouthOptions.defaultOption,
|
||||
background: IconView_Previews.backgrounds,
|
||||
bgColor: .red,
|
||||
innerColor: .green,
|
||||
bgOverlayColor: .orange,
|
||||
rightEyeColor: .orange,
|
||||
leftEyeColor: .yellow,
|
||||
mouthColor: .green,
|
||||
circleStrokeColor: .pink),
|
||||
IconView(customIcon: CustomIcon.defaultCustomIcon,
|
||||
isPreview: true)
|
||||
.frame(width: 256, height: 256, alignment: .center)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user