Skip to content

Instantly share code, notes, and snippets.

@almaleh
Last active January 19, 2019 22:17
Show Gist options
  • Save almaleh/88dadc980232eeedea6e5ec2eb4180c1 to your computer and use it in GitHub Desktop.
Save almaleh/88dadc980232eeedea6e5ec2eb4180c1 to your computer and use it in GitHub Desktop.
func checkIfTooManyPoints() {
let maxPoints = 25
if line.count > maxPoints {
updateFlattenedLayer()
// we leave two points to ensure no gaps or sharp angles
_ = line.removeFirst(maxPoints - 2)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment