summaryrefslogtreecommitdiff
path: root/delegate_darwin.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
committerPietro Gagliardi <[email protected]>2014-03-17 21:09:03 -0400
commit64d5eb541eb28e1a7e81adca66a72155d16033b4 (patch)
tree7db7c7ee787afc02823833340c3a2d0068807117 /delegate_darwin.go
parentc1807033733654db480e782acebdccda9eababc6 (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 'delegate_darwin.go')
-rw-r--r--delegate_darwin.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/delegate_darwin.go b/delegate_darwin.go
index 5999941..a1c835d 100644
--- a/delegate_darwin.go
+++ b/delegate_darwin.go
@@ -90,8 +90,9 @@ func appDelegate_windowDidResize(self C.id, sel C.SEL, notification C.id) {
r := C.objc_msgSend_stret_rect_noargs(wincv, _frame)
if sysData.resize != nil {
// winheight is used here because (0,0) is the bottom-left corner, not the top-left corner
- resizeList := sysData.resize(int(r.x), int(r.y), int(r.width), int(r.height))
- 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, int(r.height))
if err != nil {
panic("child resize failed: " + err.Error())