diff --git a/apps/go.mod b/apps/go.mod index c8af8e36..8485f212 100644 --- a/apps/go.mod +++ b/apps/go.mod @@ -3,7 +3,7 @@ module gioui.org/apps go 1.12 require ( - gioui.org/ui v0.0.0-20190714173331-587b88d346ee + gioui.org/ui v0.0.0-20190715171611-667670f9c656 github.com/google/go-github/v24 v24.0.1 golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 diff --git a/apps/gophers/main.go b/apps/gophers/main.go index f241ea09..ca1c830a 100644 --- a/apps/gophers/main.go +++ b/apps/gophers/main.go @@ -228,7 +228,7 @@ func (a *App) run() error { case app.DrawEvent: ops.Reset() a.cfg = e.Config - cs := layout.ExactConstraints(e.Size) + cs := layout.RigidConstraints(e.Size) a.Layout(ops, cs) if a.profiling { a.layoutTimings(ops, cs) @@ -457,7 +457,7 @@ func (up *userPage) commit(ops *ui.Ops, cs layout.Constraints, index int) layout sz := c.Px(ui.Dp(48)) cc := clipCircle{} cs = cc.Begin(ops, cs) - cs = cs.Exact(sz, sz) + cs = layout.RigidConstraints(cs.Constrain(image.Point{X: sz, Y: sz})) dims := widget.Image{Src: u.avatar, Rect: u.avatar.Bounds()}.Layout(c, ops, cs) dims = cc.End(dims) c1 := f.End(dims) @@ -513,7 +513,7 @@ func (a *App) layoutUsers(ops *ui.Ops, cs layout.Constraints) layout.Dimens { cs.Width.Min = cs.Width.Max in := layout.EqualInsets(ui.Dp(16)) sz := c.Px(ui.Dp(200)) - cs = cs.Exact(sz, sz) + cs = layout.RigidConstraints(cs.Constrain(image.Point{X: sz, Y: sz})) dims = a.edit.Layout(ops, in.Begin(c, ops, cs)) dims = in.End(dims) } @@ -595,7 +595,8 @@ func (a *App) user(c ui.Config, ops *ui.Ops, cs layout.Constraints, index int) l in := layout.Insets{Right: ui.Dp(8)} cc := clipCircle{} cs = cc.Begin(ops, in.Begin(c, ops, cs)) - cs = cs.Exact(c.Px(ui.Dp(48)), c.Px(ui.Dp(48))) + sz := image.Point{X: c.Px(ui.Dp(48)), Y: c.Px(ui.Dp(48))} + cs = layout.RigidConstraints(cs.Constrain(sz)) dims = widget.Image{Src: u.avatar, Rect: u.avatar.Bounds()}.Layout(c, ops, cs) dims = in.End(cc.End(dims)) } diff --git a/apps/hello/hello.go b/apps/hello/hello.go index b0f24c41..0313667a 100644 --- a/apps/hello/hello.go +++ b/apps/hello/hello.go @@ -52,7 +52,7 @@ func loop(w *app.Window) error { return e.Err case app.DrawEvent: cfg = e.Config - cs := layout.ExactConstraints(e.Size) + cs := layout.RigidConstraints(e.Size) ops.Reset() ops.Begin() draw.ColorOp{Color: maroon}.Add(ops)