|
|
@ -694,7 +694,6 @@ namespace Avalonia.Controls |
|
|
{ |
|
|
{ |
|
|
_textLayout?.Dispose(); |
|
|
_textLayout?.Dispose(); |
|
|
_textLayout = null; |
|
|
_textLayout = null; |
|
|
|
|
|
|
|
|
_textRuns = null; |
|
|
_textRuns = null; |
|
|
|
|
|
|
|
|
base.OnMeasureInvalidated(); |
|
|
base.OnMeasureInvalidated(); |
|
|
@ -707,6 +706,10 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
|
_constraint = availableSize.Deflate(padding); |
|
|
_constraint = availableSize.Deflate(padding); |
|
|
|
|
|
|
|
|
|
|
|
//Reset TextLayout otherwise constraint might be outdated.
|
|
|
|
|
|
_textLayout?.Dispose(); |
|
|
|
|
|
_textLayout = null; |
|
|
|
|
|
|
|
|
var inlines = Inlines; |
|
|
var inlines = Inlines; |
|
|
|
|
|
|
|
|
if (HasComplexContent) |
|
|
if (HasComplexContent) |
|
|
@ -837,15 +840,19 @@ namespace Avalonia.Controls |
|
|
{ |
|
|
{ |
|
|
oldValue.LogicalChildren = null; |
|
|
oldValue.LogicalChildren = null; |
|
|
oldValue.InlineHost = null; |
|
|
oldValue.InlineHost = null; |
|
|
oldValue.Invalidated -= (s, e) => InvalidateMeasure(); |
|
|
oldValue.Invalidated -= Invalidated; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (newValue is not null) |
|
|
if (newValue is not null) |
|
|
{ |
|
|
{ |
|
|
newValue.LogicalChildren = LogicalChildren; |
|
|
newValue.LogicalChildren = LogicalChildren; |
|
|
newValue.InlineHost = this; |
|
|
newValue.InlineHost = this; |
|
|
newValue.Invalidated += (s, e) => InvalidateMeasure(); |
|
|
newValue.Invalidated += Invalidated; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
void Invalidated(object? sender, EventArgs e) => InvalidateMeasure(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void IInlineHost.Invalidate() |
|
|
void IInlineHost.Invalidate() |
|
|
|