Selaa lähdekoodia

Merge branch 'master' of https://github.com/TerminalStudio/xterm.dart

xuty 3 vuotta sitten
vanhempi
sitoutus
a63420a91a
1 muutettua tiedostoa jossa 12 lisäystä ja 1 poistoa
  1. 12 1
      lib/src/ui/render.dart

+ 12 - 1
lib/src/ui/render.dart

@@ -581,8 +581,19 @@ class RenderTerminal extends RenderBox with RelayoutWhenSystemFontsChangeMixin {
         underline: cellFlags & CellFlags.underline != 0,
       );
 
+      // Flutter does not draw an underline below a space which is not between
+      // other regular characters. As only single characters are drawn, this
+      // will never produce an underline below a space in the terminal. As a
+      // workaround the regular space CodePoint 0x20 is replaced with
+      // the CodePoint 0xA0. This is a non breaking space and a underline can be
+      // drawn below it.
+      var char = String.fromCharCode(charCode);
+      if (cellFlags & CellFlags.underline != 0 && charCode == 0x20) {
+        char = String.fromCharCode(0xA0);
+      }
+
       paragraph = _paragraphCache.performAndCacheLayout(
-        String.fromCharCode(charCode),
+        char,
         style,
         hash,
       );