Skip to content

Commit 335d542

Browse files
committed
core: Fix double caret rendering in justified text
1 parent eec5e90 commit 335d542

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/display_object/edit_text.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,10 +902,11 @@ impl<'gc> EditText<'gc> {
902902

903903
let caret = if let LayoutContent::Text { start, end, .. } = &lbox.content() {
904904
if let Some(visible_selection) = visible_selection {
905+
let text_len = edit_text.text_spans.text().len();
905906
if visible_selection.is_caret()
906907
&& !edit_text.flags.contains(EditTextFlag::READ_ONLY)
907908
&& visible_selection.start() >= *start
908-
&& visible_selection.end() <= *end
909+
&& (visible_selection.end() < *end || *end == text_len)
909910
&& !visible_selection.blinks_now()
910911
{
911912
Some(visible_selection.start() - start)

0 commit comments

Comments
 (0)