mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
pixels: Bug fix: Remove IsCleared: pixels state might not match with actual state
This commit is contained in:
parent
c0eb01d69e
commit
939284820c
@ -115,9 +115,6 @@ func (i *imageImpl) Fill(clr color.Color) error {
|
||||
if i.disposed {
|
||||
return errors.New("ebiten: image is already disposed")
|
||||
}
|
||||
if clr == color.Transparent && i.pixels.IsCleared() {
|
||||
return nil
|
||||
}
|
||||
i.pixels.Fill(clr)
|
||||
return i.image.Fill(clr)
|
||||
}
|
||||
@ -131,9 +128,6 @@ func (i *imageImpl) clearIfVolatile() error {
|
||||
if !i.volatile {
|
||||
return nil
|
||||
}
|
||||
if i.pixels.IsCleared() {
|
||||
return nil
|
||||
}
|
||||
i.pixels.Clear()
|
||||
return i.image.Fill(color.Transparent)
|
||||
}
|
||||
|
@ -60,10 +60,6 @@ func (p *Pixels) Clear() {
|
||||
p.drawImageHistory = nil
|
||||
}
|
||||
|
||||
func (p *Pixels) IsCleared() bool {
|
||||
return p.basePixels == nil && p.baseColor == nil && p.drawImageHistory == nil
|
||||
}
|
||||
|
||||
func (p *Pixels) Fill(clr color.Color) {
|
||||
p.basePixels = nil
|
||||
p.baseColor = clr
|
||||
|
Loading…
Reference in New Issue
Block a user