mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: check the current error at Set and ReplacePixels
This commit is contained in:
parent
9c6b7aaca3
commit
4610505fc5
8
image.go
8
image.go
@ -747,6 +747,10 @@ func (i *Image) at(x, y int) (r, g, b, a uint8) {
|
||||
//
|
||||
// If the image is disposed, Set does nothing.
|
||||
func (i *Image) Set(x, y int, clr color.Color) {
|
||||
if ui.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
i.copyCheck()
|
||||
if i.isDisposed() {
|
||||
return
|
||||
@ -798,6 +802,10 @@ func (i *Image) Dispose() {
|
||||
//
|
||||
// When the image is disposed, ReplacePixels does nothing.
|
||||
func (i *Image) ReplacePixels(pixels []byte) {
|
||||
if ui.HasError() {
|
||||
return
|
||||
}
|
||||
|
||||
i.copyCheck()
|
||||
|
||||
if i.isDisposed() {
|
||||
|
Loading…
Reference in New Issue
Block a user