mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Bounds doesn't work when the image is disposed
This commit is contained in:
parent
0bed5a96d5
commit
cc8e8aef19
3
image.go
3
image.go
@ -534,6 +534,9 @@ func (i *Image) SubImage(r image.Rectangle) image.Image {
|
|||||||
|
|
||||||
// Bounds returns the bounds of the image.
|
// Bounds returns the bounds of the image.
|
||||||
func (i *Image) Bounds() image.Rectangle {
|
func (i *Image) Bounds() image.Rectangle {
|
||||||
|
if i.isDisposed() {
|
||||||
|
panic("ebiten: the image is already disposed")
|
||||||
|
}
|
||||||
if !i.isSubImage() {
|
if !i.isSubImage() {
|
||||||
w, h := i.mipmap.original().Size()
|
w, h := i.mipmap.original().Size()
|
||||||
return image.Rect(0, 0, w, h)
|
return image.Rect(0, 0, w, h)
|
||||||
|
Loading…
Reference in New Issue
Block a user