Skip to content

Commit 784e5f3

Browse files
committed
TDrawBuffer: allow drawing views slightly bigger than the screen size
1 parent e9a9dda commit 784e5f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/tvision/drivers.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,10 @@ ushort TDrawBuffer::moveStr( ushort indent, TStringView str, TColorAttr attr,
403403
// We must take the greatest of the screen's dimensions, because we cannot assume
404404
// that 'screenWidth > screenHeight' and TDrawBuffer can also be used to draw
405405
// vertical views (e.g. TScrollBar).
406+
// In addition, give some room for views that might exceed the screen size.
406407
static TSpan<TScreenCell> allocData() noexcept
407408
{
408-
size_t len = max(max(TScreen::screenWidth, TScreen::screenHeight), 80);
409+
size_t len = 8 + max(max(TScreen::screenWidth, TScreen::screenHeight), 80);
409410
return TSpan<TScreenCell>(new TScreenCell[len], len);
410411
}
411412

0 commit comments

Comments
 (0)