a9cc0442e2537a3d3af0f874f69b63178f769398 — Elias Naur 8 days ago 12c9dc7 master
cmd/scatter: update gio version

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

M cmd/scatter/ui.go
M go.mod
M go.sum
M cmd/scatter/ui.go => cmd/scatter/ui.go +14 -20
@@ 25,6 25,7 @@
 	"gioui.org/io/system"
 	"gioui.org/layout"
 	"gioui.org/op"
+	"gioui.org/op/clip"
 	"gioui.org/op/paint"
 	"gioui.org/text"
 	"gioui.org/unit"


@@ 312,7 313,10 @@
 		clipCenter := f32.Point{X: diameter / 2, Y: diameter / 2}
 		off := op.TransformOp{}.Offset(center.Sub(clipCenter))
 		off.Add(gtx.Ops)
-		rrect(gtx.Ops, diameter, diameter, radius, radius, radius, radius)
+		clip.RoundRect(gtx.Ops,
+			f32.Rectangle{Max: f32.Point{X: diameter, Y: diameter}},
+			radius, radius, radius, radius,
+		).Add(gtx.Ops)
 		off.Invert().Add(gtx.Ops)
 		fill{rgb(0xffffff)}.Layout(gtx)
 	}


@@ 727,7 731,11 @@
 		if r > height/2 {
 			r = height / 2
 		}
-		rrect(gtx.Ops, width, height, r, r, r, r)
+		clip.RoundRect(gtx.Ops,
+			f32.Rectangle{Max: f32.Point{
+				X: width, Y: height,
+			}}, r, r, r, r,
+		).Add(gtx.Ops)
 	}
 	paint.ColorOp{Color: b.Color}.Add(gtx.Ops)
 	paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{X: width, Y: height}}}.Add(gtx.Ops)


@@ 1265,7 1273,10 @@
 	rr := szf * .5
 	var stack op.StackOp
 	stack.Push(gtx.Ops)
-	rrect(gtx.Ops, szf, szf, rr, rr, rr, rr)
+	clip.RoundRect(gtx.Ops,
+		f32.Rectangle{Max: f32.Point{X: szf, Y: szf}},
+		rr, rr, rr, rr,
+	).Add(gtx.Ops)
 	macro.Add(gtx.Ops)
 	stack.Pop()
 }


@@ 1292,20 1303,3 @@
 	ic.imgSize = sz
 	return ic.op
 }
-
-// https://pomax.github.io/bezierinfo/#circles_cubic.
-func rrect(ops *op.Ops, width, height, se, sw, nw, ne float32) {
-	w, h := float32(width), float32(height)
-	const c = 0.55228475 // 4*(sqrt(2)-1)/3
-	var b paint.Path
-	b.Begin(ops)
-	b.Move(f32.Point{X: w, Y: h - se})
-	b.Cube(f32.Point{X: 0, Y: se * c}, f32.Point{X: -se + se*c, Y: se}, f32.Point{X: -se, Y: se}) // SE
-	b.Line(f32.Point{X: sw - w + se, Y: 0})
-	b.Cube(f32.Point{X: -sw * c, Y: 0}, f32.Point{X: -sw, Y: -sw + sw*c}, f32.Point{X: -sw, Y: -sw}) // SW
-	b.Line(f32.Point{X: 0, Y: nw - h + sw})
-	b.Cube(f32.Point{X: 0, Y: -nw * c}, f32.Point{X: nw - nw*c, Y: -nw}, f32.Point{X: nw, Y: -nw}) // NW
-	b.Line(f32.Point{X: w - ne - nw, Y: 0})
-	b.Cube(f32.Point{X: ne * c, Y: 0}, f32.Point{X: ne, Y: ne - ne*c}, f32.Point{X: ne, Y: ne}) // NE
-	b.End().Add(ops)
-}

M go.mod => go.mod +1 -1
@@ 3,7 3,7 @@
 go 1.13
 
 require (
-	gioui.org v0.0.0-20191108212706-9def3153de74
+	gioui.org v0.0.0-20191109184610-d8c9cb426c41
 	github.com/eliasnaur/libsignal-protocol-go v0.0.0-20190626062856-3295f72b181e
 	github.com/emersion/go-imap v1.0.0-rc.1
 	github.com/emersion/go-imap-idle v0.0.0-20190519112320-2704abd7050e

M go.sum => 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-20191108212706-9def3153de74 h1:DQbJNkUDqxKVIcvWy6l2k8vpYQFiv2XxpEMRN00b3/0=
-gioui.org v0.0.0-20191108212706-9def3153de74/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
+gioui.org v0.0.0-20191109184610-d8c9cb426c41 h1:MC7OzV8nE8N1fBl3MgZLe8xquNkr+uezK0+1cnxrJFc=
+gioui.org v0.0.0-20191109184610-d8c9cb426c41/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/RadicalApp/complete v0.0.0-20170329192659-17e6c0ee499b h1:cAULFohNVfNzco0flF4okSPg3s7/tCj+hMIldtYZo4c=
 github.com/RadicalApp/complete v0.0.0-20170329192659-17e6c0ee499b/go.mod h1:zZ3+l0EkpT2ZPnoamPBG50PBUtQrXwwyJ6elQZMmqgk=