Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASTextNode] Fix wrong truncation after constrained size changes #1924

Merged
merged 2 commits into from
Jul 15, 2016
Merged

[ASTextNode] Fix wrong truncation after constrained size changes #1924

merged 2 commits into from
Jul 15, 2016

Conversation

maicki
Copy link
Contributor

@maicki maicki commented Jul 14, 2016

Throw away the all subcomponents to create them with the new constrained size new as well as let the truncater do it's job again for the new constrained size. This is necessary as after a truncation did happen the context would use the truncated string and not the original string to truncate based on the new constrained size

This should fix #1841 and finally #1865

@ghost ghost added the CLA Signed label Jul 14, 2016
@maicki maicki changed the title Throw away all subcomponents of the text kit renderer if constraints are changing [ASTextNode] Fix wrong truncation after constrained size changes Jul 14, 2016
…are changing

Throw away the all subcomponents to create them with the new constrained size new as well as let the truncater do it's job again for the new constrained size. This is necessary as after a truncation did happen the context would use the truncated string and not the original string to truncate based on the new constrained size
@ghost ghost added the CLA Signed label Jul 14, 2016
@nguyenhuy
Copy link
Contributor

nguyenhuy commented Jul 14, 2016

LGTM! It's sad that we have to throw away these components. On the other hand, it's necessary to avoid nasty bugs that are hard to catch, and constrained size is not changed that frequent anyway.

@Adlai-Holler
Copy link
Contributor

Love this, merge it at will!

@Adlai-Holler Adlai-Holler merged commit 013c163 into facebookarchive:master Jul 15, 2016
@@ -123,14 +123,14 @@ - (void)setConstrainedSize:(CGSize)constrainedSize
if (!CGSizeEqualToSize(constrainedSize, _constrainedSize)) {
_sizeIsCalculated = NO;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also reset _calculatedSize here, to CGSizeZero I guess.

Arthraim pushed a commit to iftechio/AsyncDisplayKit that referenced this pull request Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Truncated ASTextNode appearing in node that should not be truncated.
5 participants