mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
cmd/gophers,cmd/hello: update to latest API
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-2
@@ -42,7 +42,8 @@ func loop(w *app.Window) {
|
||||
if err != nil {
|
||||
panic("failed to load font")
|
||||
}
|
||||
var faces measure.Faces
|
||||
var cfg ui.Config
|
||||
faces := &measure.Faces{Config: &cfg}
|
||||
maroon := color.NRGBA{127, 0, 0, 255}
|
||||
face := faces.For(regular, ui.Sp(72))
|
||||
message := "Hello, Gio"
|
||||
@@ -51,7 +52,7 @@ func loop(w *app.Window) {
|
||||
e := <-w.Events()
|
||||
switch e := e.(type) {
|
||||
case app.Draw:
|
||||
faces.Cfg = e.Config
|
||||
cfg = e.Config
|
||||
cs := layout.ExactConstraints(w.Size())
|
||||
ops.Reset()
|
||||
draw.OpColor{Col: maroon}.Add(ops)
|
||||
|
||||
Reference in New Issue
Block a user