diff --git a/label.go b/label.go index 7601562..d970637 100644 --- a/label.go +++ b/label.go @@ -68,11 +68,14 @@ func (w *Label) Compute(e render.Engine) { // Max rect to encompass all lines of text. var maxRect = render.Rect{} for _, line := range lines { + if line == "" { + line = "" + } + text.Text = line // only this line at this time. rect, err := e.ComputeTextRect(text) if err != nil { panic(fmt.Sprintf("%s: failed to compute text rect: %s", w, err)) // TODO return an error - return } if rect.W > maxRect.W {