add affinity for localPosition (#1287)

pull/1299/head
Luy2077 2 years ago committed by GitHub
parent 829a4f16a7
commit 1a5a51182a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/src/widgets/editor.dart

@ -1006,7 +1006,9 @@ class RenderEditor extends RenderEditableContainerBox
if (textSelection.isCollapsed) {
final child = childAtPosition(textSelection.extent);
final localPosition = TextPosition(
offset: textSelection.extentOffset - child.container.offset);
offset: textSelection.extentOffset - child.container.offset,
affinity: textSelection.affinity,
);
final localOffset = child.getOffsetForCaret(localPosition);
final parentData = child.parentData as BoxParentData;
return <TextSelectionPoint>[

Loading…
Cancel
Save