charmbracelet / charmbracelet/x
x/mosaic rendering width does not bake in assumptions about character aspect ratio
- Dominant language
- Go
- Stars
- 314
- Forks
- 94
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 2
Description
### Description
Given the example in x/mosaic, if I were instead to remove the lines enforcing a height and width, the documentation states that the default here should be the base image height and width. Given the input image of a square --
```golang
m := mosaic.New() // .Width(80).Height(40)
```
I would expect that the terminal render would still be a square. However, we see the actual output
The fix seems to be manually changing the render width to twice the image size, as reported by `img.Bounds().Max.X`, i.e.
```golang
mosaic.New().Width(img.Bounds().Max.X * 2).Render(...)
```
Is this behavior expected?
### Version
_No response_
### Environment
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.