summaryrefslogtreecommitdiff
path: root/sysdata.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-07 14:32:25 -0400
committerPietro Gagliardi <[email protected]>2014-04-07 14:32:25 -0400
commit3bf215ae4edb616c14c4525638cf54425d6e8f36 (patch)
tree3c253a36643b8ab6891545c217d9af906efc3358 /sysdata.go
parent00acf74177e520c2f961fb478e7674d24c9077c9 (diff)
Split out the common resizing code into its own function so that it's all in one place. This will also affect what happens if I switch to DeferWindowPos() on Windows.
Diffstat (limited to 'sysdata.go')
-rw-r--r--sysdata.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/sysdata.go b/sysdata.go
index 7f43a3e..1507912 100644
--- a/sysdata.go
+++ b/sysdata.go
@@ -87,3 +87,16 @@ type resizerequest struct {
width int
height int
}
+
+func (s *sysData) doResize(x int, y int, width int, height int, winheight int) {
+ if s.resize != nil {
+ s.resizes = s.resizes[0:0] // set len to 0 without changing cap
+ s.resize(x, y, width, height, &s.resizes)
+ for _, s := range s.resizes {
+ err := s.sysData.setRect(s.x, s.y, s.width, s.height, winheight)
+ if err != nil {
+ panic("child resize failed: " + err.Error())
+ }
+ }
+ }
+}