terminal/src/renderer/vt
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 Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
ut_lib Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
dirs Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
invalidate.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
math.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
paint.cpp Move cursor in conpty correctly after a backspace when we've delayed an EOL wrap (#4403) 2020-02-11 21:52:19 +00:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
sources.inc inbox: reflect incoming changes from Windows 2019-05-14 16:16:43 -07:00
state.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
tracing.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
tracing.hpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
vt-renderer-common.vcxitems Unify and clean up the common build properties (#3429) 2019-11-05 14:29:11 -08:00
vtrenderer.hpp Move cursor in conpty correctly after a backspace when we've delayed an EOL wrap (#4403) 2020-02-11 21:52:19 +00:00
VtSequences.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
WinTelnetEngine.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
WinTelnetEngine.hpp Make the terminal parser/adapter and related classes use modern… (#3956) 2019-12-19 14:12:53 -08:00
Xterm256Engine.cpp Revert locking changes (#3488) 2019-11-08 13:44:52 -08:00
Xterm256Engine.hpp Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00
XtermEngine.cpp Move cursor in conpty correctly after a backspace when we've delayed an EOL wrap (#4403) 2020-02-11 21:52:19 +00:00
XtermEngine.hpp Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00