Fix horizontal scrolling bugs in AtlasEngine/DxEngine (#15707)

This commit fixes a number of issues around horizontal scrolling.
DxEngine only had one bug, where the clip rect would cause any content
outside of the actual viewport to be invisible. AtlasEngine had more
bugs, mostly around the conversion from textbuffer-relative coordinates
to viewport-relative coordinates, since AtlasEngine stores things like
the cursor position, attributes, etc., relative to the viewport.

It also renames `cellCount` to `viewportCellCount`, because I realized
that it might have to deal with a `textBufferCellCount` or similar in
the future. I hope that the new name is more descriptive of what it
refers to.

Future improvements to AtlasEngine in particular would be to not copy
the entire `Settings` struct every time the horizontal scroll offset
changes, and to trim trailing whitespace before shaping text.

This is in preparation for #1860

## Validation Steps Performed
* Patch `RenderingTests` to run in the main (and not alt) buffer
* Horizontal scrolling of line renditions and attributes works 
* Selection retains its position (mostly) 
This commit is contained in:
Leonard Hecker
2023-07-18 20:35:18 +02:00
committed by GitHub
parent 6873c85d2d
commit 89c39b06ed
11 changed files with 109 additions and 82 deletions

View File

@@ -146,11 +146,18 @@
<DisplayString Condition="_occupied">{glyphIndex}</DisplayString>
</Type>
<Type Name="Microsoft::Console::Render::Atlas::BackendD3D::AtlasFontFaceEntry">
<DisplayString Condition="!_occupied">(empty)</DisplayString>
<DisplayString Condition="_occupied">{(void*)fontFace.m_ptr}, {lineRendition}</DisplayString>
<Type Name="Microsoft::Console::Render::Atlas::BackendD3D::AtlasFontFaceEntryInner">
<DisplayString>{(void*)fontFace.m_ptr}, {lineRendition}</DisplayString>
<Expand>
<ExpandedItem>glyphs</ExpandedItem>
</Expand>
</Type>
<Type Name="Microsoft::Console::Render::Atlas::BackendD3D::AtlasFontFaceEntry">
<DisplayString Condition="!inner._Mypair._Myval2">(empty)</DisplayString>
<DisplayString Condition="inner._Mypair._Myval2">{*inner._Mypair._Myval2}</DisplayString>
<Expand>
<ExpandedItem>*inner._Mypair._Myval2</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>