all: move Now from system.Config to system.FrameEvent

Then, make layout.Context.Now a field, copied from FrameEvent.Now.

API change:

	gofmt -r 'gtx.Now() -> gtx.Now'

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-09 23:18:04 +02:00
parent 81a84d874b
commit 6380baacb6
14 changed files with 25 additions and 34 deletions
+1 -1
View File
@@ -108,6 +108,7 @@ func (w *window) draw(sync bool) {
const inchPrDp = 1.0 / 163
w.w.Event(FrameEvent{
FrameEvent: system.FrameEvent{
Now: time.Now(),
Size: image.Point{
X: int(params.width + .5),
Y: int(params.height + .5),
@@ -121,7 +122,6 @@ func (w *window) draw(sync bool) {
Config: &config{
pxPerDp: float32(params.dpi) * inchPrDp,
pxPerSp: float32(params.sdpi) * inchPrDp,
now: time.Now(),
},
},
Sync: sync,