Skip to content

Commit

Permalink
add pics for diamond
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Kraev committed Feb 16, 2023
1 parent dfb44ba commit 8084c53
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
Binary file added Pics/Diamond.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Pics/Diamond_pr2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion Sources/Shapes/CustomShapes/Diamond.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ public struct Diamond: Shape {

public struct Diamond_Previews: PreviewProvider {
public static var previews: some View {
VStack {
VStack(spacing: 40) {
Text("Diamond")
.padding(.horizontal, 24)
.padding(.vertical, 16)
.background(
Diamond()
.stroke(.blue, lineWidth: 2)
)

Diamond()
.stroke(.gray, lineWidth: 1)
.frame(width: 100, height: 50)
Expand Down
21 changes: 16 additions & 5 deletions Sources/Shapes/ViewModifiers/Diamonded.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,21 @@ public extension View {
public struct DiamondedModifier_Previews: PreviewProvider {
public static var previews: some View {

Text("Diamonded modifier")
.foregroundColor(.black)
.padding(16)
.diamond(withStroke: Color.orange,
fill: .blue)
VStack(spacing: 40) {
Text("Diamond modifier")
.foregroundColor(.black)
.padding(24)
.diamond(top: .init(x: 40, y: 0),
bottom: .init(x: 0, y: 0),
withStroke: .black,
lineWidth: 2.0,
fill: .yellow)

Text("Diamond modifier")
.foregroundColor(.black)
.padding(16)
.diamond(withStroke: Color.orange,
fill: .blue)
}
}
}

0 comments on commit 8084c53

Please sign in to comment.