Skip to content

[BUG] First line of text is centered when content align is non-centered #16

@nedpals

Description

@nedpals

Describe the bug
When the ContentAlign is set to Left/Right and the TitlePos is not set to Inside, the first line of the content is still aligned to the center.
To Reproduce

package main

import "github.com/Delta456/box-cli-maker/v2"

func main() {
     bx := box.New(box.Config{
             Px: 2, 
             Py: 0, 
             Type: "Single", 
             ContentAlign: "Left", 
             Color: "Green", 
             TitlePos: "Top"
     })
     bx.Print("System Info", "Lorem Ipsum\nfoo bar hello world\n123456 abcdefghijk")
}

Expected behavior
The first line of the content should be aligned based on ContentAlign.

┌ System Info ───────────────────────────────────────────┐
│  OS:     linux ubuntu                                  │
│  Arch:   x86_64                                        │
│  CPU:    Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz x 8  │
│  RAM:    7.7 GiB                                       │
└────────────────────────────────────────────────────────┘

Screenshots / Logs

┌ System Info ───────────────────────────────────────────┐
│                  OS:     linux ubuntu                  │
│  Arch:   x86_64                                        │
│  CPU:    Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz x 8  │
│  RAM:    7.7 GiB                                       │
└────────────────────────────────────────────────────────┘

Versions (please complete the following information, if relevant):

  • Software version: 2.0.1
  • OS: Ubuntu 20.04
  • Golang version: `go version go1.15.2 linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions