Finally, the code is clean enough to add more stuff

This commit is contained in:
Michał Gdula 2024-01-25 20:29:32 +00:00
parent d0ebc1ee54
commit 00c449abff
3 changed files with 46 additions and 54 deletions

View file

@ -18,4 +18,9 @@ func (p *penTool) Draw(offset raylib.Vector2) {
raylib.DrawLineEx(startPoint, endPoint, p.Size, p.Color)
raylib.DrawCircle(int32(startPoint.X), int32(startPoint.Y), p.Size/2, p.Color)
}
// Add a circle at the end of the stroke
if len(p.Points) > 0 {
endPoint := raylib.Vector2Add(p.Points[len(p.Points)-1], offset)
raylib.DrawCircle(int32(endPoint.X), int32(endPoint.Y), p.Size/2, p.Color)
}
}