~eliasnaur/gio

9196ce0369bc03920862ccd57b559224117d8c9e — Elias Naur a month ago c19ed05
cmd,example: bump gio version

Signed-off-by: Elias Naur <mail@eliasnaur.com>
6 files changed, 24 insertions(+), 24 deletions(-)

M cmd/go.mod
M cmd/go.sum
M example/go.mod
M example/go.sum
M example/gophers/ui.go
M example/tabs/slider.go
M cmd/go.mod => cmd/go.mod +1 -1
@@ 3,7 3,7 @@ module gioui.org/cmd
go 1.13

require (
	gioui.org v0.0.0-20200531220444-28bf9e200143
	gioui.org v0.0.0-20200602100720-c19ed0534297
	github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4
	github.com/chromedp/chromedp v0.5.2
	golang.org/x/image v0.0.0-20190802002840-cff245a6509b

M cmd/go.sum => cmd/go.sum +2 -2
@@ 1,6 1,6 @@
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20200531220444-28bf9e200143 h1:B3j67PQaeCzLlleL3ZZgkYgGamJEsGBOqqXsoJ7YgJE=
gioui.org v0.0.0-20200531220444-28bf9e200143/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200602100720-c19ed0534297 h1:Ia8/4NBUEWj6/I7Q2lTOKoyGd2DBnX6av6N+71ZPTtg=
gioui.org v0.0.0-20200602100720-c19ed0534297/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/chromedp/cdproto v0.0.0-20191114225735-6626966fbae4 h1:QD3KxSJ59L2lxG6MXBjNHxiQO2RmxTQ3XcK+wO44WOg=

M example/go.mod => example/go.mod +1 -1
@@ 3,7 3,7 @@ module gioui.org/example
go 1.13

require (
	gioui.org v0.0.0-20200531220444-28bf9e200143
	gioui.org v0.0.0-20200602100720-c19ed0534297
	github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
	github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
	github.com/google/go-github/v24 v24.0.1

M example/go.sum => example/go.sum +2 -2
@@ 1,7 1,7 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
gioui.org v0.0.0-20200531220444-28bf9e200143 h1:B3j67PQaeCzLlleL3ZZgkYgGamJEsGBOqqXsoJ7YgJE=
gioui.org v0.0.0-20200531220444-28bf9e200143/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200602100720-c19ed0534297 h1:Ia8/4NBUEWj6/I7Q2lTOKoyGd2DBnX6av6N+71ZPTtg=
gioui.org v0.0.0-20200602100720-c19ed0534297/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=

M example/gophers/ui.go => example/gophers/ui.go +4 -7
@@ 352,24 352,21 @@ type clipCircle struct {
}

func (c *clipCircle) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	var m op.MacroOp
	m.Record(gtx.Ops)
	m := op.Record(gtx.Ops)
	dims := w(gtx)
	m.Stop()
	call := m.Stop()
	max := dims.Size.X
	if dy := dims.Size.Y; dy > max {
		max = dy
	}
	szf := float32(max)
	rr := szf * .5
	var stack op.StackOp
	stack.Push(gtx.Ops)
	defer op.Push(gtx.Ops).Pop()
	clip.Rect{
		Rect: f32.Rectangle{Max: f32.Point{X: szf, Y: szf}},
		NE:   rr, NW: rr, SE: rr, SW: rr,
	}.Op(gtx.Ops).Add(gtx.Ops)
	m.Add()
	stack.Pop()
	call.Add(gtx.Ops)
	return dims
}


M example/tabs/slider.go => example/tabs/slider.go +14 -11
@@ 18,9 18,11 @@ type Slider struct {

	push int

	last *op.Ops
	next *op.Ops

	nextCall op.CallOp
	lastCall op.CallOp

	t0     time.Time
	offset float32
}


@@ 34,7 36,8 @@ func (s *Slider) PushRight() { s.push = -1 }
// Layout lays out widget that can be pushed.
func (s *Slider) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
	if s.push != 0 {
		s.last, s.next = s.next, new(op.Ops)
		s.next = nil
		s.lastCall = s.nextCall
		s.offset = float32(s.push)
		s.t0 = gtx.Now()
		s.push = 0


@@ 73,20 76,20 @@ func (s *Slider) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
		if s.next == nil {
			s.next = new(op.Ops)
		}
		s.next.Reset()
		gtx := gtx
		gtx.Ops = s.next
		gtx.Ops.Reset()
		m := op.Record(gtx.Ops)
		dims = w(gtx)
		s.nextCall = m.Stop()
	}

	if s.offset == 0 {
		op.CallOp{Ops: s.next}.Add(gtx.Ops)
		s.nextCall.Add(gtx.Ops)
		return dims
	}

	var stack op.StackOp
	stack.Push(gtx.Ops)
	defer stack.Pop()
	defer op.Push(gtx.Ops).Pop()

	offset := smooth(s.offset)



@@ 94,22 97,22 @@ func (s *Slider) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions {
		op.TransformOp{}.Offset(f32.Point{
			X: float32(dims.Size.X) * (offset - 1),
		}).Add(gtx.Ops)
		op.CallOp{Ops: s.last}.Add(gtx.Ops)
		s.lastCall.Add(gtx.Ops)

		op.TransformOp{}.Offset(f32.Point{
			X: float32(dims.Size.X),
		}).Add(gtx.Ops)
		op.CallOp{Ops: s.next}.Add(gtx.Ops)
		s.nextCall.Add(gtx.Ops)
	} else {
		op.TransformOp{}.Offset(f32.Point{
			X: float32(dims.Size.X) * (offset + 1),
		}).Add(gtx.Ops)
		op.CallOp{Ops: s.last}.Add(gtx.Ops)
		s.lastCall.Add(gtx.Ops)

		op.TransformOp{}.Offset(f32.Point{
			X: float32(-dims.Size.X),
		}).Add(gtx.Ops)
		op.CallOp{Ops: s.next}.Add(gtx.Ops)
		s.nextCall.Add(gtx.Ops)
	}
	return dims
}