mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
graphics: Swap error checking
This commit is contained in:
parent
d60f662f57
commit
046a6cd014
6
image.go
6
image.go
@ -149,12 +149,12 @@ func (i *Image) isDisposed() bool {
|
||||
// DrawImage always returns nil as of 1.5.0-alpha.
|
||||
func (i *Image) DrawImage(img *Image, options *DrawImageOptions) error {
|
||||
i.copyCheck()
|
||||
if i == img {
|
||||
panic("ebiten: Image.DrawImage: img must be different from the receiver")
|
||||
}
|
||||
if img.isDisposed() {
|
||||
panic("ebiten: the given image to DrawImage must not be disposed")
|
||||
}
|
||||
if i == img {
|
||||
panic("ebiten: Image.DrawImage: img must be different from the receiver")
|
||||
}
|
||||
if i.isDisposed() {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user