aboutsummaryrefslogtreecommitdiffstats
path: root/test/region.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-02-10 09:30:42 -0500
committerSam Anthony <sam@samanthony.xyz>2026-02-10 09:30:42 -0500
commit3ce04a4d3dc8d174b520d85804e5c8dce8c5d08f (patch)
tree8ae271f0f151e1870b25574a88218f2040841247 /test/region.go
parentfa47463d8fa0dbd1b12ef227c15fa573e45244cd (diff)
downloadgui-3ce04a4d3dc8d174b520d85804e5c8dce8c5d08f.zip
add layout resize functions
Diffstat (limited to 'test/region.go')
-rw-r--r--test/region.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/region.go b/test/region.go
index 0b99a3a..682e23f 100644
--- a/test/region.go
+++ b/test/region.go
@@ -27,11 +27,11 @@ func run() {
mux, env := gui.NewMux(w)
- // Create region in bottom-right quadrant of window
- resize := func(r image.Rectangle) image.Rectangle {
- return image.Rect(r.Min.X+r.Dx()/2, r.Min.Y+r.Dy()/2, r.Max.X, r.Max.Y)
- }
- region := layout.NewRegion(mux.MakeEnv(), resize, layout.Background(bg))
+ // Background
+ back := layout.NewRegion(mux.MakeEnv(), layout.ResizeAll, layout.Background(bg))
+
+ // Create region on top of background, in bottom-right quadrant
+ region := layout.NewRegion(back, layout.ResizeQuad4)
go blinker(region)
for event := range env.Events() {