all: make unit.Converter concrete and rename to Metric

An interface for scaling dp and sp is overkill, at least for all
current uses. Make it a concrete struct type, and rename it to the
shorter and more precise Metric.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-17 11:47:14 +02:00
parent 1603a6f3ee
commit 596e321610
15 changed files with 86 additions and 85 deletions
+2 -7
View File
@@ -17,10 +17,11 @@ import (
// operations that describes what to display and how to handle
// 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
// Metric converts device independent dp and sp to device pixels.
Metric unit.Metric
// Size is the dimensions of the window.
Size image.Point
// Insets is the insets to apply.
@@ -51,12 +52,6 @@ type FrameEvent struct {
Queue event.Queue
}
// Config defines the essential properties of
// the environment.
type Config interface {
unit.Converter
}
// DestroyEvent is the last event sent through
// a window event channel.
type DestroyEvent struct {