fix GLFrame.SetBounds to not reallocate when not necessary

This commit is contained in:
faiface 2017-04-05 23:20:55 +02:00
parent b41e117ac6
commit 8db95af845
1 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,10 @@ func NewGLFrame(bounds pixel.Rect) *GLFrame {
// SetBounds resizes the GLFrame to the new bounds.
func (gf *GLFrame) SetBounds(bounds pixel.Rect) {
if bounds == gf.Bounds() {
return
}
mainthread.Call(func() {
oldF := gf.frame