|
@@ -1,6 +1,9 @@
|
|
|
package door
|
|
|
|
|
|
-import "strings"
|
|
|
+import (
|
|
|
+ "log"
|
|
|
+ "strings"
|
|
|
+)
|
|
|
|
|
|
type BorderStyle int
|
|
|
|
|
@@ -38,6 +41,10 @@ func (p *Panel) Output() string {
|
|
|
// Top line / border
|
|
|
output += Goto(p.X, row) + p.BorderColor + box_style.top_left
|
|
|
if p.Title != "" {
|
|
|
+ if p.TitleOffset+len(p.Title) > p.Width {
|
|
|
+ log.Panicf("Panel (not wide enough) Width %d : Title size %d + offset %d = %d\n",
|
|
|
+ p.Width, len(p.Title), p.TitleOffset, p.TitleOffset+len(p.Title))
|
|
|
+ }
|
|
|
output += strings.Repeat(box_style.top, p.TitleOffset) + p.Title
|
|
|
}
|
|
|
output += strings.Repeat(box_style.top, p.Width-(p.TitleOffset+len(p.Title))) + box_style.top_right
|