|
|
|
@ -118,7 +118,6 @@ func eventloop() {
|
|
|
|
|
margin := layout.UniformInset(unit.Dp(10)) |
|
|
|
|
|
|
|
|
|
b := ble.NewBLE() |
|
|
|
|
b.Enable(w) |
|
|
|
|
|
|
|
|
|
state := "starting" |
|
|
|
|
var hr int |
|
|
|
@ -239,13 +238,13 @@ func eventloop() {
|
|
|
|
|
p2a := f32.Point{(h1-s2)/2, (h1-s2)/2} |
|
|
|
|
p2b := f32.Point{s2 + (h1-s2)/2, s2 + (h1-s2)/2} |
|
|
|
|
r2 := f32.Rectangle{p2a, p2b} |
|
|
|
|
clip.Rect{ Rect: r1, NE: h1/2, NW: h1/2, SE: h1/2, SW: h1/2}.Op(gtx.Ops).Add(gtx.Ops) |
|
|
|
|
clip.RRect{ Rect: r1, NE: h1/2, NW: h1/2, SE: h1/2, SW: h1/2}.Add(gtx.Ops) |
|
|
|
|
paint.ColorOp{Color: blue}.Add(gtx.Ops) |
|
|
|
|
paint.PaintOp{Rect: r1}.Add(gtx.Ops) |
|
|
|
|
clip.Rect{ Rect: r2, NE: s2/2, NW: s2/2, SE: s2/2, SW: s2/2}.Op(gtx.Ops).Add(gtx.Ops) |
|
|
|
|
clip.RRect{ Rect: r2, NE: s2/2, NW: s2/2, SE: s2/2, SW: s2/2}.Add(gtx.Ops) |
|
|
|
|
paint.ColorOp{Color: white}.Add(gtx.Ops) |
|
|
|
|
paint.PaintOp{Rect: r2}.Add(gtx.Ops) |
|
|
|
|
op.TransformOp{}.Offset(p2a).Add(gtx.Ops) |
|
|
|
|
op.Offset(p2a).Add(gtx.Ops) |
|
|
|
|
gtx.Constraints.Max.X = int(s2) |
|
|
|
|
gtx.Constraints.Max.Y = int(s2) |
|
|
|
|
gtx.Constraints.Min.X = int(s2) |
|
|
|
@ -489,7 +488,7 @@ func eventloop() {
|
|
|
|
|
case e := <-w.Events(): |
|
|
|
|
switch e := e.(type) { |
|
|
|
|
case system.DestroyEvent: |
|
|
|
|
return |
|
|
|
|
os.Exit(0) |
|
|
|
|
case system.FrameEvent: |
|
|
|
|
gtx := layout.NewContext(&ops, e) |
|
|
|
|
if e.Size.X > e.Size.Y { |
|
|
|
@ -502,6 +501,8 @@ func eventloop() {
|
|
|
|
|
return margin.Layout(gtx, page) |
|
|
|
|
}) |
|
|
|
|
e.Frame(gtx.Ops) |
|
|
|
|
default: |
|
|
|
|
handleEvent(e, b) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|