You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And in case FormattedTextSource.CreateTextStyleRun receives non-empty collection in textModifier parameter it executes main part of method's body which works slowly with big amounts of text.
Create simple multiline TextBox and set SelectionForegroundBrush to any value. <TextBox Name="TextBox" AcceptsReturn="True" SelectionForegroundBrush="Blue" />
And fill it with a quite large amount of text (200kb).
Try to select anything - selection works with freezes.
Describe the bug
Selection in TextBox becomes too slow with large amount of text
TextPresenter.CreateTextLayout has condition that initializes textStyleOverrides when SelectionForegroundBrush is not null
Avalonia/src/Avalonia.Controls/Presenters/TextPresenter.cs
Line 555 in 49fb9ff
And in case FormattedTextSource.CreateTextStyleRun receives non-empty collection in textModifier parameter it executes main part of method's body which works slowly with big amounts of text.
Avalonia/src/Avalonia.Base/Media/TextFormatting/FormattedTextSource.cs
Line 54 in 49fb9ff
To Reproduce
Create simple multiline TextBox and set SelectionForegroundBrush to any value.
<TextBox Name="TextBox" AcceptsReturn="True" SelectionForegroundBrush="Blue" />
And fill it with a quite large amount of text (200kb).
Try to select anything - selection works with freezes.
Expected behavior
No response
Avalonia version
11.1.3
OS
No response
Additional context
sample_text.txt
The text was updated successfully, but these errors were encountered: