diff --git a/apps/go.mod b/apps/go.mod index 720e52ab..0eb6792c 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-20190805141354-8c3305e88b0d + gioui.org/ui v0.0.0-20190807181153-dd35a48a61ab 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/ui.go b/apps/gophers/ui.go index d2384c5a..49059365 100644 --- a/apps/gophers/ui.go +++ b/apps/gophers/ui.go @@ -18,7 +18,6 @@ import ( _ "net/http/pprof" "gioui.org/ui" - gdraw "gioui.org/ui/draw" "gioui.org/ui/f32" "gioui.org/ui/gesture" "gioui.org/ui/input" @@ -29,6 +28,7 @@ import ( "gioui.org/ui/system" "gioui.org/ui/text" "gioui.org/ui/widget" + "gioui.org/ui/paint" "golang.org/x/exp/shiny/iconvg" "github.com/google/go-github/v24/github" @@ -107,7 +107,7 @@ var theme struct { func colorMaterial(ops *ui.Ops, color color.RGBA) ui.MacroOp { var mat ui.MacroOp mat.Record(ops) - gdraw.ColorOp{Color: color}.Add(ops) + paint.ColorOp{Color: color}.Add(ops) mat.Stop() return mat } @@ -424,7 +424,7 @@ func (f fill) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens { Max: f32.Point{X: float32(d.X), Y: float32(d.Y)}, } f.material.Add(ops) - gdraw.DrawOp{Rect: dr}.Add(ops) + paint.PaintOp{Rect: dr}.Add(ops) return layout.Dimens{Size: d, Baseline: d.Y} } @@ -474,9 +474,9 @@ func fab(ops *ui.Ops, cs layout.Constraints, ico image.Image, mat ui.MacroOp, si rr := float32(size) * .5 rrect(ops, float32(size), float32(size), rr, rr, rr, rr) mat.Add(ops) - gdraw.DrawOp{Rect: f32.Rectangle{Max: f32.Point{X: float32(size), Y: float32(size)}}}.Add(ops) - gdraw.ImageOp{Src: ico, Rect: ico.Bounds()}.Add(ops) - gdraw.DrawOp{ + paint.PaintOp{Rect: f32.Rectangle{Max: f32.Point{X: float32(size), Y: float32(size)}}}.Add(ops) + paint.ImageOp{Src: ico, Rect: ico.Bounds()}.Add(ops) + paint.PaintOp{ Rect: toRectF(ico.Bounds().Add(dp)), }.Add(ops) return layout.Dimens{Size: dims} @@ -513,7 +513,7 @@ func (ic *icon) image(cfg ui.Config) image.Image { func rrect(ops *ui.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 gdraw.PathBuilder + var b paint.PathBuilder b.Init(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 diff --git a/apps/hello/hello.go b/apps/hello/hello.go index 503d9fff..1ca083e7 100644 --- a/apps/hello/hello.go +++ b/apps/hello/hello.go @@ -10,9 +10,9 @@ import ( "gioui.org/ui" "gioui.org/ui/app" - "gioui.org/ui/draw" "gioui.org/ui/layout" "gioui.org/ui/measure" + "gioui.org/ui/paint" "gioui.org/ui/text" "golang.org/x/image/font/gofont/goregular" @@ -52,7 +52,7 @@ func loop(w *app.Window) error { ops.Reset() var material ui.MacroOp material.Record(ops) - draw.ColorOp{Color: maroon}.Add(ops) + paint.ColorOp{Color: maroon}.Add(ops) material.Stop() text.Label{Material: material, Face: face, Alignment: text.Center, Text: message}.Layout(ops, cs) w.Draw(ops)