[fix]: The selection effect can't be seen as the textLine with background color (#429)

pull/430/head
appflowy 4 years ago committed by GitHub
parent 926afac5f5
commit 7bf237f3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      lib/src/widgets/text_line.dart

@ -812,15 +812,6 @@ class RenderEditableTextLine extends RenderEditableBox {
if (_body != null) {
final parentData = _body!.parentData as BoxParentData;
final effectiveOffset = offset + parentData.offset;
if (enableInteractiveSelection &&
line.documentOffset <= textSelection.end &&
textSelection.start <= line.documentOffset + line.length - 1) {
final local = localSelection(line, textSelection, false);
_selectedRects ??= _body!.getBoxesForSelection(
local,
);
_paintSelection(context, effectiveOffset);
}
if (hasFocus &&
cursorCont.show.value &&
@ -837,6 +828,17 @@ class RenderEditableTextLine extends RenderEditableBox {
cursorCont.style.paintAboveText) {
_paintCursor(context, effectiveOffset, line.hasEmbed);
}
// paint the selection on the top
if (enableInteractiveSelection &&
line.documentOffset <= textSelection.end &&
textSelection.start <= line.documentOffset + line.length - 1) {
final local = localSelection(line, textSelection, false);
_selectedRects ??= _body!.getBoxesForSelection(
local,
);
_paintSelection(context, effectiveOffset);
}
}
}

Loading…
Cancel
Save