From 4223324689d0e65604f9569dd166960690ce9a98 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 9 Aug 2022 18:54:33 +0800 Subject: [PATCH] fix: cursor height error --- .../flowy_editor/lib/render/rich_text/flowy_rich_text.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart index 882f98c4d5..81d9159d40 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/render/rich_text/flowy_rich_text.dart @@ -41,6 +41,8 @@ class _FlowyRichTextState extends State 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 with Selectable { ? Colors.transparent : Colors.grey, fontSize: baseFontSize, + height: lineHeight, ), ), ], @@ -200,6 +203,7 @@ class _FlowyRichTextState extends State with Selectable { .map((insert) => RichTextStyle( attributes: insert.attributes ?? {}, text: insert.content, + height: lineHeight, ).toTextSpan()) .toList(growable: false), );