vector: Bug fix: wrong color value

This commit is contained in:
Hajime Hoshi 2019-04-14 02:11:25 +09:00
parent 8d912a402f
commit 6bd9ef6abd
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ func update(screen *ebiten.Image) error {
op := &vector.DrawPathOptions{}
op.LineWidth = 4
op.StrokeColor = color.White
op.StrokeColor = color.RGBA{0xdb, 0x56, 0x20, 0xff}
path.Draw(screen, op)
return nil

View File

@ -76,7 +76,7 @@ func (p *Path) strokeVertices(lineWidth float32, clr color.Color) (vertices []eb
sw, sh := emptyImage.Size()
r, g, b, a := clr.RGBA()
rf, gf, bf, af := float32(r/0xffff), float32(g/0xffff), float32(b/0xffff), float32(a/0xffff)
rf, gf, bf, af := float32(r)/0xffff, float32(g)/0xffff, float32(b)/0xffff, float32(a)/0xffff
for i, s := range p.segs {
si, co := math.Sincos(s.atan2() + math.Pi/2)
dx, dy := float32(co)*lineWidth/2, float32(si)*lineWidth/2