mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphcis: Refactoring: (*Image).Size()
This commit is contained in:
parent
75049c4048
commit
df9c67d5db
8
image.go
8
image.go
@ -73,13 +73,7 @@ func (i *Image) copyCheck() {
|
||||
|
||||
// Size returns the size of the image.
|
||||
func (i *Image) Size() (width, height int) {
|
||||
w := 0
|
||||
h := 0
|
||||
if i.restorable != nil {
|
||||
w, h = i.restorable.Size()
|
||||
} else if i.sharedImagePart != nil {
|
||||
_, _, w, h = i.sharedImagePart.region()
|
||||
}
|
||||
_, _, w, h := i.region()
|
||||
return w, h
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user