diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-17 21:09:03 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-17 21:09:03 -0400 |
| commit | 64d5eb541eb28e1a7e81adca66a72155d16033b4 (patch) | |
| tree | 7db7c7ee787afc02823833340c3a2d0068807117 /stdwndclass_windows.go | |
| parent | c1807033733654db480e782acebdccda9eababc6 (diff) | |
Changed the new resizing code so that it uses the same allocated slice per window instead of making a new one to store all the resize requests each time.
Diffstat (limited to 'stdwndclass_windows.go')
| -rw-r--r-- | stdwndclass_windows.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index 54cec7d..ea443de 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -53,8 +53,9 @@ func stdWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam panic("GetClientRect failed: " + err.Error()) } // top-left corner is (0,0) so no need for winheight - resizeList := s.resize(int(r.Left), int(r.Top), int(r.Right), int(r.Bottom)) - for _, s := range resizeList { + s.resizes = s.resizes[0:0] // set len to 0 without changing cap + s.resize(0, 0, width, height, &s.resizes) + for _, s := range s.resizes { err = s.sysData.setRect(s.x, s.y, s.width, s.height, 0) if err != nil { panic("child resize failed: " + err.Error()) |
