Skip to content

Commit

Permalink
Fix setMaxArea not accounting for the cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
lhecker committed Jul 8, 2022
1 parent 0641bb3 commit b5763fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/renderer/atlas/AtlasEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,10 @@ namespace Microsoft::Console::Render

void setMaxArea(size_t max) noexcept
{
_maxArea = clamp(max, _absoluteMinArea, _absoluteMaxArea);
// We need to reserve at least 1 extra `tileArea`, because the tile
// at position {0,0} is already reserved for the cursor texture.
const auto tileArea = static_cast<size_t>(_tileSize.x) * static_cast<size_t>(_tileSize.y);
_maxArea = clamp(max + tileArea, _absoluteMinArea, _absoluteMaxArea);
_updateCanGenerate();
}

Expand Down

0 comments on commit b5763fa

Please sign in to comment.