mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
example/gophers: update gio version
gofmt -w -s . as well. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -140,8 +140,8 @@ const (
|
||||
_WM_KEYUP = 0x0101
|
||||
_WM_LBUTTONDOWN = 0x0201
|
||||
_WM_LBUTTONUP = 0x0202
|
||||
_WM_MBUTTONDOWN =0x0207
|
||||
_WM_MBUTTONUP =0x0208
|
||||
_WM_MBUTTONDOWN = 0x0207
|
||||
_WM_MBUTTONUP = 0x0208
|
||||
_WM_MOUSEMOVE = 0x0200
|
||||
_WM_MOUSEWHEEL = 0x020A
|
||||
_WM_PAINT = 0x000F
|
||||
@@ -151,8 +151,8 @@ const (
|
||||
_WM_SHOWWINDOW = 0x0018
|
||||
_WM_SIZE = 0x0005
|
||||
_WM_SYSKEYDOWN = 0x0104
|
||||
_WM_RBUTTONDOWN =0x0204
|
||||
_WM_RBUTTONUP = 0x0205
|
||||
_WM_RBUTTONDOWN = 0x0204
|
||||
_WM_RBUTTONUP = 0x0205
|
||||
_WM_TIMER = 0x0113
|
||||
_WM_UNICHAR = 0x0109
|
||||
_WM_USER = 0x0400
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/cmd
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20191108212017-cc43588aba76
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb
|
||||
github.com/chromedp/cdproto v0.0.0-20191009033829-c22f49c9ff0a
|
||||
github.com/chromedp/chromedp v0.5.1
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
|
||||
+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-20191108212017-cc43588aba76 h1:bzz4BbuSez21kkS3jMb2ryitfmmXXOuFR48LM21iXok=
|
||||
gioui.org v0.0.0-20191108212017-cc43588aba76/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb h1:5bQ+OfWFec3Dqgf1wpqtwGQZq/yaVGsgTKM1D4SNIek=
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
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-20191009033829-c22f49c9ff0a h1:AuIGvB6IuWpMEdfKQ+t77D6dzLpNftzxAsktehYyWn8=
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/example
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20191108212017-cc43588aba76
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb
|
||||
github.com/google/go-github/v24 v24.0.1
|
||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||
|
||||
+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-20191108212017-cc43588aba76 h1:bzz4BbuSez21kkS3jMb2ryitfmmXXOuFR48LM21iXok=
|
||||
gioui.org v0.0.0-20191108212017-cc43588aba76/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb h1:5bQ+OfWFec3Dqgf1wpqtwGQZq/yaVGsgTKM1D4SNIek=
|
||||
gioui.org v0.0.0-20191109184219-65c783179dbb/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
|
||||
+2
-18
@@ -19,6 +19,7 @@ import (
|
||||
"gioui.org/io/profile"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/op/clip"
|
||||
"gioui.org/op/paint"
|
||||
"gioui.org/text"
|
||||
"gioui.org/unit"
|
||||
@@ -372,28 +373,11 @@ func (c *clipCircle) Layout(gtx *layout.Context, w layout.Widget) {
|
||||
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)
|
||||
m.Add(gtx.Ops)
|
||||
stack.Pop()
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
const longTextSample = `1. I learned from my grandfather, Verus, to use good manners, and to
|
||||
put restraint on anger. 2. In the famous memory of my father I had a
|
||||
pattern of modesty and manliness. 3. Of my mother I learned to be
|
||||
|
||||
Reference in New Issue
Block a user