Box doesn't crash when cetering a nil texture
This commit is contained in:
parent
09cec81f30
commit
e38cbe7205
2
box.go
2
box.go
@ -326,7 +326,7 @@ func (this *box) Draw (can canvas.Canvas) {
|
|||||||
pen.Rectangle(bounds)
|
pen.Rectangle(bounds)
|
||||||
|
|
||||||
// centered texture
|
// centered texture
|
||||||
if this.textureMode == textureModeCenter {
|
if this.textureMode == textureModeCenter && this.texture != nil {
|
||||||
textureBounds := this.texture.Bounds()
|
textureBounds := this.texture.Bounds()
|
||||||
textureOrigin :=
|
textureOrigin :=
|
||||||
bounds.Min.
|
bounds.Min.
|
||||||
|
Reference in New Issue
Block a user