Skip to content

Commit b6f5cbe

Browse files
authored
Fix cursor invalidation when line renditions are used (microsoft#17234)
## Summary of the Pull Request When the renderer calculates the invalidate region for the cursor, it needs to take the line rendition into account. But it was using a relative coordinate rather than absolute coordinate when looking up the line rendition for the row, so the calculated region could easily be incorrect. With this PR we now use the line rendition that was already being cached in the `CursorOptions` structure, so we avoid needing to look it up anyway. Similarly I've replaced the `IsCursorDoubleWidth` lookup with the value that was already cached in the `CursorOptions` structure. ## Validation Steps Performed I've confirmed that the test case in issue microsoft#17226 is now working as expected. ## PR Checklist - [x] Closes microsoft#17226
1 parent 34ecc5b commit b6f5cbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/base/renderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,8 @@ void Renderer::_invalidateCurrentCursor() const
11781178
const auto view = buffer.GetSize();
11791179
const auto coord = _currentCursorOptions.coordCursor;
11801180

1181-
const auto lineRendition = buffer.GetLineRendition(coord.y);
1182-
const auto cursorWidth = _pData->IsCursorDoubleWidth() ? 2 : 1;
1181+
const auto lineRendition = _currentCursorOptions.lineRendition;
1182+
const auto cursorWidth = _currentCursorOptions.fIsDoubleWidth ? 2 : 1;
11831183

11841184
til::rect rect{ coord.x, coord.y, coord.x + cursorWidth, coord.y + 1 };
11851185
rect = BufferToScreenLine(rect, lineRendition);

0 commit comments

Comments
 (0)