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
+3 -3
View File
@@ -18,6 +18,9 @@ import (
// input.
type FrameEvent struct {
Config Config
// Now is the current animation. Use Now instead of time.Now to
// synchronize animation and to avoid the time.Now call overhead.
Now time.Time
// Size is the dimensions of the window.
Size image.Point
// Insets is the insets to apply.
@@ -51,9 +54,6 @@ type FrameEvent struct {
// Config defines the essential properties of
// the environment.
type Config interface {
// Now returns the current animation time.
Now() time.Time
unit.Converter
}