mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
vector: bug fix: LineTo should consider the current cursor
This commit is contained in:
parent
a75472b524
commit
6113afae46
@ -74,7 +74,7 @@ type Path struct {
|
||||
cur point
|
||||
}
|
||||
|
||||
// MoveTo starts a new subpath with the given position (x, y) without adding any strokes,
|
||||
// MoveTo starts a new subpath with the given position (x, y) without adding a subpath,
|
||||
//
|
||||
// MoveTo updates the current position to (x, y).
|
||||
func (p *Path) MoveTo(x, y float32) {
|
||||
@ -90,7 +90,10 @@ func (p *Path) MoveTo(x, y float32) {
|
||||
func (p *Path) LineTo(x, y float32) {
|
||||
if len(p.subpaths) == 0 || p.subpaths[len(p.subpaths)-1].closed {
|
||||
p.subpaths = append(p.subpaths, &subpath{
|
||||
points: []point{{x: x, y: y}},
|
||||
points: []point{
|
||||
p.cur,
|
||||
{x: x, y: y},
|
||||
},
|
||||
})
|
||||
p.cur = point{x: x, y: y}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user