From 7f9f10075fe7bb1c8690309d0417437e284ccbd7 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sat, 13 Apr 2019 10:18:00 +0200 Subject: [PATCH] Replaced implementation of WidthOf by TextWidth. - TextDimensions (the underlying al_get_text_dimensions) returns the dimensions of the printable characters (non-whitespace) which gives weird results when measuring spaces. --- ui/allg5ui/font.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/allg5ui/font.go b/ui/allg5ui/font.go index e767b27..1a4b8cf 100644 --- a/ui/allg5ui/font.go +++ b/ui/allg5ui/font.go @@ -34,7 +34,7 @@ func (f *font) Height() float32 { } func (f *font) WidthOf(t string) float32 { - return f.Measure(t).Dx() + return f.f.TextWidth(t) } func (f *font) Measure(t string) geom.RectangleF32 {