Skip to content

Commit f8dfbb8

Browse files
committed
fix: selected text is sometimes not visible
#4
1 parent 23e49e9 commit f8dfbb8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/LiveMarkdown.Avalonia/MarkdownTextBlock.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ private IEnumerable<Rect> TextLayoutHitTestTextRange(int start, int length)
243243
}
244244
}
245245

246+
protected override void OnMeasureInvalidated()
247+
{
248+
var textRuns = _textRuns;
249+
base.OnMeasureInvalidated();
250+
_textRuns = textRuns;
251+
}
252+
246253
public new void SelectAll()
247254
{
248255
SetCurrentValue(SelectionStartProperty, 0);

0 commit comments

Comments
 (0)