-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
straight line #28
straight line #28
Conversation
Thanks for your contribution! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
yeah that's weird. I'll see if I can track it down. |
@LinusGeffarth I've finally managed to get around to this, and I think the solution is to put a if shouldDrawStraight {
lines.removeLast()
setNeedsDisplay()
let newLine = Line(path: CGMutablePath(),
brush: Brush(color: brush.color, width: brush.width, opacity: brush.opacity, blendMode: brush.blendMode))
newLine.path.addPath(createNewStraightPath())
lines.append(newLine)
drawingHistory = lines
} else {
let newPath = createNewPath()
if let currentPath = lines.last {
currentPath.path.addPath(newPath)
}
}
} Would you like me to make another PR, or are you happy to test and implement this yourself? But I am also sometimes getting an error thrown in |
Thanks. If you could open a PR, that'd be appreciated. |
done. The other issue I was having was caused something else in my project, so I don't think there is anything else to be done. |
Is this still considered experimental after invalidating ( |
For what it's worth, I've not had any issues in the 3 months of using this feature. |
I've had a go at implement a straight line for #4
I've made a public variable
isStraight
which, when set to
true
creates a straight line between the first touch point and the current pointUsing the methods