From 784e5f361a46ce3b806b782aa076bb47a4d5a912 Mon Sep 17 00:00:00 2001 From: magiblot Date: Fri, 25 Oct 2024 15:50:57 +0200 Subject: [PATCH] TDrawBuffer: allow drawing views slightly bigger than the screen size --- source/tvision/drivers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/tvision/drivers.cpp b/source/tvision/drivers.cpp index 3ae09e62..7213dac4 100644 --- a/source/tvision/drivers.cpp +++ b/source/tvision/drivers.cpp @@ -403,9 +403,10 @@ ushort TDrawBuffer::moveStr( ushort indent, TStringView str, TColorAttr attr, // We must take the greatest of the screen's dimensions, because we cannot assume // that 'screenWidth > screenHeight' and TDrawBuffer can also be used to draw // vertical views (e.g. TScrollBar). +// In addition, give some room for views that might exceed the screen size. static TSpan allocData() noexcept { - size_t len = max(max(TScreen::screenWidth, TScreen::screenHeight), 80); + size_t len = 8 + max(max(TScreen::screenWidth, TScreen::screenHeight), 80); return TSpan(new TScreenCell[len], len); }