Skip to content

Commit

Permalink
TDrawBuffer: allow drawing views slightly bigger than the screen size
Browse files Browse the repository at this point in the history
  • Loading branch information
magiblot committed Oct 25, 2024
1 parent e9a9dda commit 784e5f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/tvision/drivers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TScreenCell> 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<TScreenCell>(new TScreenCell[len], len);
}

Expand Down

0 comments on commit 784e5f3

Please sign in to comment.