mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
shareable: Use CompositeModeSourceOver when possible at Fill
This commit is contained in:
parent
1150fc69d0
commit
339155f63d
@ -296,7 +296,11 @@ func (i *Image) Fill(r, g, b, a uint8) {
|
||||
rf, gf, bf, af)
|
||||
is := graphics.QuadIndices()
|
||||
|
||||
i.DrawImage(emptyImage, vs, is, nil, graphics.CompositeModeCopy, graphics.FilterNearest, graphics.AddressClampToZero)
|
||||
c := graphics.CompositeModeSourceOver
|
||||
if a < 0xff {
|
||||
c = graphics.CompositeModeCopy
|
||||
}
|
||||
i.DrawImage(emptyImage, vs, is, nil, c, graphics.FilterNearest, graphics.AddressClampToZero)
|
||||
}
|
||||
|
||||
func (i *Image) ReplacePixels(p []byte) {
|
||||
|
Loading…
Reference in New Issue
Block a user