浏览代码

fix: cursor height error

Lucas.Xu 2 年之前
父节点
当前提交
4223324689
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart

+ 4 - 0
frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart

@@ -41,6 +41,8 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
   final _textKey = GlobalKey();
   final _placeholderTextKey = GlobalKey();
 
+  final lineHeight = 1.5;
+
   RenderParagraph get _renderParagraph =>
       _textKey.currentContext?.findRenderObject() as RenderParagraph;
 
@@ -145,6 +147,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
                 ? Colors.transparent
                 : Colors.grey,
             fontSize: baseFontSize,
+            height: lineHeight,
           ),
         ),
       ],
@@ -200,6 +203,7 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {
             .map((insert) => RichTextStyle(
                   attributes: insert.attributes ?? {},
                   text: insert.content,
+                  height: lineHeight,
                 ).toTextSpan())
             .toList(growable: false),
       );