Fix caret display when cursor on embed line

pull/332/head
Xin Yao 4 years ago
parent 231769565f
commit 138d89e5fc
  1. 8
      lib/src/widgets/proxy.dart

@ -103,8 +103,12 @@ class RenderEmbedProxy extends RenderProxyBox implements RenderContentProxyBox {
@override
Offset getOffsetForCaret(TextPosition position, Rect? caretPrototype) {
assert(position.offset <= 1 && position.offset >= 0);
return position.offset == 0 ? Offset.zero : Offset(size.width, 0);
assert(position.offset == 1 || position.offset == 0);
return position.offset == 0
? Offset.zero
: Offset(
size.width - (caretPrototype == null ? 0 : caretPrototype.width),
0);
}
@override

Loading…
Cancel
Save