Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: #811 The height of selection areas in same line is not same.
Lucas.Xufe2790fb6845
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/flowy_rich_text.dart b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/flowy_rich_text.dartindex 01949aa99c..bdfae73d66 100644--- a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/flowy_rich_text.dart+++ b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/flowy_rich_text.dart@@ -174,6 +174,8 @@ class _FlowyRichTextState extends State<FlowyRichText> with Selectable {final textSpan = _textSpan;return RichText(key: _textKey,+ textHeightBehavior: const TextHeightBehavior(+ applyHeightToFirstAscent: false, applyHeightToLastDescent: false),text: widget.textSpanDecorator != null? widget.textSpanDecorator!(textSpan): textSpan,diff --git a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dartindex c924709948..4ac2adc39f 100644--- a/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart+++ b/frontend/app_flowy/packages/flowy_editor/lib/src/render/rich_text/rich_text_style.dart@@ -192,17 +192,7 @@ class RichTextStyle {TextSpan toTextSpan() => _toTextSpan(height);double get topPadding {- if (height == 1.0) {- return 0;- }- // TODO: Need to be optimized.- final painter =- TextPainter(text: _toTextSpan(height), textDirection: TextDirection.ltr)- ..layout();- final basePainter =- TextPainter(text: _toTextSpan(null), textDirection: TextDirection.ltr)- ..layout();- return painter.height - basePainter.height;+ return 0;}TextSpan _toTextSpan(double? height) {