ebiten: check the current error at Set and ReplacePixels

This commit is contained in:
Hajime Hoshi 2022-03-05 01:52:55 +09:00
parent 9c6b7aaca3
commit 4610505fc5

View File

@ -747,6 +747,10 @@ func (i *Image) at(x, y int) (r, g, b, a uint8) {
// //
// If the image is disposed, Set does nothing. // If the image is disposed, Set does nothing.
func (i *Image) Set(x, y int, clr color.Color) { func (i *Image) Set(x, y int, clr color.Color) {
if ui.HasError() {
return
}
i.copyCheck() i.copyCheck()
if i.isDisposed() { if i.isDisposed() {
return return
@ -798,6 +802,10 @@ func (i *Image) Dispose() {
// //
// When the image is disposed, ReplacePixels does nothing. // When the image is disposed, ReplacePixels does nothing.
func (i *Image) ReplacePixels(pixels []byte) { func (i *Image) ReplacePixels(pixels []byte) {
if ui.HasError() {
return
}
i.copyCheck() i.copyCheck()
if i.isDisposed() { if i.isDisposed() {