Browse Source

Fixed #600: Incorrect TextBox selection coloring for non-left aligned text.

pull/715/head
Mikhail Kanygin 10 years ago
parent
commit
40560a8ee2
  1. 5
      src/Avalonia.Controls/Presenters/TextPresenter.cs

5
src/Avalonia.Controls/Presenters/TextPresenter.cs

@ -106,6 +106,11 @@ namespace Avalonia.Controls.Presenters
{ {
var start = Math.Min(selectionStart, selectionEnd); var start = Math.Min(selectionStart, selectionEnd);
var length = Math.Max(selectionStart, selectionEnd) - start; var length = Math.Max(selectionStart, selectionEnd) - start;
// issue #600: set constaint before any FormattedText manipulation
// see base.Render(...) implementation
FormattedText.Constraint = Bounds.Size;
var rects = FormattedText.HitTestTextRange(start, length); var rects = FormattedText.HitTestTextRange(start, length);
if (_highlightBrush == null) if (_highlightBrush == null)

Loading…
Cancel
Save