From 43f39bc2e3538931ee5d48b2ea9ab4f2b007d2ad Mon Sep 17 00:00:00 2001 From: ricky Date: Wed, 22 Mar 2017 10:55:25 -0700 Subject: [PATCH] [ASTextNode] Reset _composedTruncationText when attributedText is updated (#3210) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [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 --- Source/ASTextNode.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASTextNode.mm b/Source/ASTextNode.mm index bc07a08249..add6d9ae49 100644 --- a/Source/ASTextNode.mm +++ b/Source/ASTextNode.mm @@ -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) {