From 73f1b6a320f90cfec9de8878ec06fa351966beaf Mon Sep 17 00:00:00 2001 From: zyxkad Date: Sat, 2 Dec 2023 18:30:32 -0700 Subject: [PATCH] we should devide on int but not floor, or the text will be out of shape --- gui/label.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/label.go b/gui/label.go index a79bc175..71b8ab02 100644 --- a/gui/label.go +++ b/gui/label.go @@ -100,12 +100,12 @@ func (l *Label) SetText(text string) { } // Update label panel dimensions - width, height := float32(textImage.Rect.Dx()), float32(textImage.Rect.Dy()) + width, height := textImage.Rect.Dx(), textImage.Rect.Dy() if runtime.GOOS == "darwin" { // since we enlarged the font texture for higher quality, we have to scale it back to it's original point size width, height = width / 2, height / 2 } - l.Panel.SetContentSize(width, height) + l.Panel.SetContentSize(float32(width), float32(height)) } // Text returns the label text.