[ASTextNode] Reset _composedTruncationText when attributedText is updated (#3210)

* [ASTextNode] Reset _composedTruncationText when attributedText is updated

Current issue:
1) Set `attributedText` in `ASTextNode` with whiteColor
2) `_composedTruncationText` gets updated to take on this new color attribute
3) Set the `attributedText` with greenColor
4) The `_composedTruncationText` gets updated with the new attributes, but does NOT overwrite any existing attributes — i.e., does not overwrite the white color with green. Comment from `_locked_prepareTruncationStringForDrawing:`:
`
// Add any of the original string's attributes to the truncation string,
// but don't overwrite any of the truncation string's attributes
`

* michael’s suggestion
This commit is contained in:
ricky
2017-03-22 10:55:25 -07:00
committed by Adlai Holler
parent c08ecd7c93
commit 43f39bc2e3

View File

@@ -1292,7 +1292,7 @@ static NSAttributedString *DefaultTruncationAttributedString()
{
//If we have neither return the default
if (!_additionalTruncationMessage && !_truncationAttributedText) {
return _composedTruncationText;
return DefaultTruncationAttributedString();
}
// Short circuit if we only have one or the other.
if (!_additionalTruncationMessage) {