hterm: set line-height of wide-characters to exact height
Currently if you display a wide character, the font will often cause the
line height to be a bit bigger than normal. This leads to weird jank as
the lines shift up/down based on what characters happen to be in them.
By setting the line-height of the wide characters span, we force them to
render in the same space as other "normal" content.
Depending on the glyph, this might overlap with previous lines, but since
the current behavior overlaps with successive lines and looks ugly, this
should hopefully provide a more consistent experience.
BUG=chromium:727957
Change-Id: I95cdc1e068724754bca09f53bb3c71690ead1054
Reviewed-on: https://chromium-review.googlesource.com/519762
Reviewed-by: Brandon Gilmore <varz@google.com>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index b685230..bfc3989 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -1371,6 +1371,7 @@
' display: inline-block;' +
' text-align: center;' +
' width: calc(var(--hterm-charsize-width) * 2);' +
+ ' line-height: var(--hterm-charsize-height);' +
'}' +
':root {' +
' --hterm-charsize-width: ' + this.scrollPort_.characterSize.width + 'px;' +