terminal/src/renderer/dx
Michael Niksa 4420950337
Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668)
## Summary of the Pull Request
- Height adjustment of a glyph is now restricted to itself in the DX
  renderer instead of applying to the entire run
- ConPTY compensates for drawing the right half of a fullwidth
  character. The entire render base has this behavior restored now as
  well.

## PR Checklist
* [x] Closes #2191
* [x] I work here
* [x] Tests added/passed
* [x] No doc
* [x] Am core contributor.

## Detailed Description of the Pull Request / Additional comments
Two issues:
1. On the DirectX renderer side, when confronted with shrinking a glyph,
   the correction code would apply the shrunken size to the entire run, not
   just the potentially individual glyph that needed to be reduced in size.
   Unfortunately while adjusting the horizontal X width can be done for
   each glyph in a run, the vertical Y height has to be adjusted for an
   entire run. So the solution here was to split the individual glyph
   needing shrinking out of the run into its own run so it can be shrunk.
2. On the ConPTY side, there was a long standing TODO that was never
   completed to deal with a request to draw only the right half of a
   two-column character. This meant that when encountering a request for
   the right half only, we would transmit the entire full character to be
   drawn, left and right halves, struck over the right half position. Now
   we correct the cursor back a position (if space) and draw it out so the
   right half is struck over where we believe the right half should be (and
   the left half is updated as well as a consequence, which should be OK.)

The reason this happens right now is because despite VIM only updating
two cells in the buffer, the differential drawing calculation in the
ConPTY is very simplistic and intersects only rectangles. This means
from the top left most character drawn down to the row/col cursor count
indicator in vim's modeline are redrawn with each character typed. This
catches the line below the edited line in the typing and refreshes it.
But incorrectly.

We need to address making ConPTY smarter about what it draws
incrementally as it's clearly way too chatty. But I plan to do that with
some of the structures I will be creating to solve #778.

## Validation Steps Performed
- Ran the scenario listed in #2191 in vim in the Terminal
- Added unit tests similar to examples given around glyph/text mapping
  in runs from Microsoft community page
2020-02-21 00:24:12 +00:00
..
lib Add experimental retro terminal effects (#3468) 2019-12-12 13:44:01 +00:00
ut_dx Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668) 2020-02-21 00:24:12 +00:00
CustomTextLayout.cpp Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668) 2020-02-21 00:24:12 +00:00
CustomTextLayout.h Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668) 2020-02-21 00:24:12 +00:00
CustomTextRenderer.cpp dx: don't check the OS version multiple times (#3480) 2019-11-08 14:14:46 -08:00
CustomTextRenderer.h remove null check from glyph run drawing as it's truly optional (#2791) 2019-09-17 10:25:22 -07:00
dirs Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668) 2020-02-21 00:24:12 +00:00
DxRenderer.cpp Restrict DX run height adjustment to only relevant glyph AND Correct PTY rendering on trailing half of fullwidth glyphs (#4668) 2020-02-21 00:24:12 +00:00
DxRenderer.hpp Add DxEngine drawing ETW tracing for debugging and diagnostics purposes (#4664) 2020-02-20 23:13:43 +00:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ScreenPixelShader.h Merged PR 4182306: [Git2Git] Merged PR 4182266: conhost: don't use D3DCompiler on inside-windows builds (and delete the shaders) 2020-01-23 00:42:56 +00:00
ScreenVertexShader.h Merged PR 4182306: [Git2Git] Merged PR 4182266: conhost: don't use D3DCompiler on inside-windows builds (and delete the shaders) 2020-01-23 00:42:56 +00:00
sources.inc Merged PR 4182306: [Git2Git] Merged PR 4182266: conhost: don't use D3DCompiler on inside-windows builds (and delete the shaders) 2020-01-23 00:42:56 +00:00