mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 04:22:05 +01:00
vector: Bug fix: wrong color value
This commit is contained in:
parent
8d912a402f
commit
6bd9ef6abd
@ -86,7 +86,7 @@ func update(screen *ebiten.Image) error {
|
|||||||
|
|
||||||
op := &vector.DrawPathOptions{}
|
op := &vector.DrawPathOptions{}
|
||||||
op.LineWidth = 4
|
op.LineWidth = 4
|
||||||
op.StrokeColor = color.White
|
op.StrokeColor = color.RGBA{0xdb, 0x56, 0x20, 0xff}
|
||||||
path.Draw(screen, op)
|
path.Draw(screen, op)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -76,7 +76,7 @@ func (p *Path) strokeVertices(lineWidth float32, clr color.Color) (vertices []eb
|
|||||||
|
|
||||||
sw, sh := emptyImage.Size()
|
sw, sh := emptyImage.Size()
|
||||||
r, g, b, a := clr.RGBA()
|
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 {
|
for i, s := range p.segs {
|
||||||
si, co := math.Sincos(s.atan2() + math.Pi/2)
|
si, co := math.Sincos(s.atan2() + math.Pi/2)
|
||||||
dx, dy := float32(co)*lineWidth/2, float32(si)*lineWidth/2
|
dx, dy := float32(co)*lineWidth/2, float32(si)*lineWidth/2
|
||||||
|
Loading…
Reference in New Issue
Block a user