Skip to content

Instantly share code, notes, and snippets.

@JetForMe
Created May 7, 2021 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JetForMe/5c358c8af097564adf35b957ce865e27 to your computer and use it in GitHub Desktop.
Save JetForMe/5c358c8af097564adf35b957ce865e27 to your computer and use it in GitHub Desktop.
struct CurveEditor: View {
var body: some View
{
GeometryReader { geom in
let width = geom.width // Make the rest of the code a bit cleaner
let height = geom. height
Path { path in
path.move(to: CGPoint(x: 10.0, y: 10.0))
path.addLine(to: CGPoint(x: geom.size.width - 10.0, y: geom.size.height - 10.0))
}
.stroke(style: StrokeStyle(lineWidth: 20.0, lineCap: .round))
.foregroundColor(.blue)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment