minor stability change in Canvas.SetBounds
This commit is contained in:
parent
46f21a3096
commit
7f38aac901
|
@ -164,7 +164,9 @@ func (c *Canvas) SetBounds(bounds pixel.Rect) {
|
||||||
c.bounds = bounds
|
c.bounds = bounds
|
||||||
|
|
||||||
// if this bounds fit into the original bounds, no need to reallocate
|
// if this bounds fit into the original bounds, no need to reallocate
|
||||||
if c.orig.borders.Contains(bounds.Pos) && c.orig.borders.Contains(bounds.Pos+bounds.Size) {
|
borX, borY, borW, borH := intBounds(c.orig.borders)
|
||||||
|
bndX, bndY, bndW, bndH := intBounds(bounds)
|
||||||
|
if borX <= bndX && bndX+bndW <= borX+borW && borY <= bndY && bndY+bndH <= borY+borH {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue