ui: add Config.Sp and Config.Dp convenience methods

And rename Pixels to Val.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-05-16 19:32:47 +02:00
parent acf345a0f8
commit 00cb158247
7 changed files with 26 additions and 16 deletions
+2 -2
View File
@@ -103,7 +103,7 @@ func (f *Faces) init() {
}
func (f *textFace) Layout(str string, singleLine bool, maxWidth int) *text.Layout {
ppem := fixed.Int26_6(f.faces.Cfg.Pixels(f.size)*64 + .5)
ppem := fixed.Int26_6(f.faces.Cfg.Val(f.size)*64 + .5)
lk := layoutKey{
f: f.font.Font,
ppem: ppem,
@@ -122,7 +122,7 @@ func (f *textFace) Layout(str string, singleLine bool, maxWidth int) *text.Layou
}
func (f *textFace) Path(str text.String) *draw.Path {
ppem := fixed.Int26_6(f.faces.Cfg.Pixels(f.size)*64 + .5)
ppem := fixed.Int26_6(f.faces.Cfg.Val(f.size)*64 + .5)
pk := pathKey{
f: f.font.Font,
ppem: ppem,