all: rename package ui to unit

Package ui is now only about units except for the Config.Now method.
Remove Now and rename Config to Converter. Add layout.Config to
replace the old ui.Config.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-09-30 16:42:12 +02:00
parent 1d3360699e
commit 3784ece6dd
20 changed files with 95 additions and 101 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import (
"gioui.org/f32"
"gioui.org/layout"
"gioui.org/op/paint"
"gioui.org/ui"
"gioui.org/unit"
)
// Image is a widget that displays an image.
@@ -31,7 +31,7 @@ func (im Image) Layout(gtx *layout.Context) {
var w, h int
if im.Scale == 0 {
const dpPrPx = 160 / 72
w, h = gtx.Px(ui.Dp(wf*dpPrPx)), gtx.Px(ui.Dp(hf*dpPrPx))
w, h = gtx.Px(unit.Dp(wf*dpPrPx)), gtx.Px(unit.Dp(hf*dpPrPx))
} else {
w, h = int(wf*im.Scale+.5), int(hf*im.Scale+.5)
}