ui: document types and methods

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-08 14:54:51 +02:00
parent aa703dfc3e
commit 3c924e2a18
2 changed files with 16 additions and 4 deletions
+4
View File
@@ -25,14 +25,18 @@ const (
UnitSp
)
// Px returns the Value for v device pixels.
func Px(v float32) Value {
return Value{V: v, U: UnitPx}
}
// Px returns the Value for v device independent
// pixels.
func Dp(v float32) Value {
return Value{V: v, U: UnitDp}
}
// Sp returns the Value for v scaled dps.
func Sp(v float32) Value {
return Value{V: v, U: UnitSp}
}