apps: use DrawEvent.Size instead of Window.Size

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-07-14 13:10:42 +02:00
parent 6e97d65af1
commit 26543ba1a5
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ module gioui.org/apps
go 1.12
require (
gioui.org/ui v0.0.0-20190713112858-112368a2e39a
gioui.org/ui v0.0.0-20190714110834-6e97d65af145
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
+1 -1
View File
@@ -228,7 +228,7 @@ func (a *App) run() error {
case app.DrawEvent:
ops.Reset()
a.cfg = e.Config
cs := layout.ExactConstraints(a.w.Size())
cs := layout.ExactConstraints(e.Size)
a.Layout(ops, cs)
if a.profiling {
a.layoutTimings(ops, cs)
+1 -1
View File
@@ -52,7 +52,7 @@ func loop(w *app.Window) error {
return e.Err
case app.DrawEvent:
cfg = e.Config
cs := layout.ExactConstraints(w.Size())
cs := layout.ExactConstraints(e.Size)
ops.Reset()
ops.Begin()
draw.ColorOp{Color: maroon}.Add(ops)