mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +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.
|
// 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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user