mirror of https://github.com/mum4k/termdash.git
Bugfix - correctly determine area on a braille canvas.
This commit is contained in:
parent
310ea212d3
commit
54b6dce805
|
@ -115,7 +115,7 @@ func (c *Canvas) Size() image.Point {
|
|||
// than the area used to create the braille canvas.
|
||||
func (c *Canvas) Area() image.Rectangle {
|
||||
ar := c.regular.Area()
|
||||
return image.Rect(0, 0, ar.Dx()*ColMult, ar.Dx()*RowMult)
|
||||
return image.Rect(0, 0, ar.Dx()*ColMult, ar.Dy()*RowMult)
|
||||
}
|
||||
|
||||
// Clear clears all the content on the canvas.
|
||||
|
|
|
@ -109,6 +109,12 @@ func TestNew(t *testing.T) {
|
|||
wantSize: image.Point{6, 12},
|
||||
wantArea: image.Rect(0, 0, 6, 12),
|
||||
},
|
||||
{
|
||||
desc: "braille from non-zero-based multi-cell rectangular area",
|
||||
ar: image.Rect(6, 6, 9, 10),
|
||||
wantSize: image.Point{6, 16},
|
||||
wantArea: image.Rect(0, 0, 6, 16),
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
|
|
Loading…
Reference in New Issue