-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Truncated ASTextNode appearing in node that should not be truncated. #1841
Comments
@nickvelloff Great report! Would you be able to modify one of our examples, or make a new one, that generates this behavior? It might be as simple as calling measure: at one size, having that display, and after a timer (or a tap) having it measure at another size. You may be able to use the Kittens app by setting the cells to a fixed height and changing the text, as tapping the cells makes the image take up more of the cell. I can see why this would happen for items outside of any preload ranges - but it certainly shouldn't happen at all, and indeed is probably a missing invalidateCalculatedLayout somewhere. Should not be that hard to fix. What framework version? We have some changes to ASTextNode in master, although I don't think they will fix this. |
@appleguy I'm working on an example to reproduce with the lease amount of unrelated factors. I've pretty much sticking to |
@appleguy I did everything I could to boil this down to something easily reproducible. Alas, it took a lot more to build the environment necessary than I had hoped. The issue is there are currently a lot of customizations required to get ASCollectionNode/View to transition from one layout to another (animated). Once a constrained size is received for a node, it never asks again. That is unless I do all the things I do to force it to transition, hence all the custom code you'll see. My new approach to test and learn is taking advantage of Playgrounds. So I went ahead and did the example that way, in hopes of it being easier to debug. Curious as to your thoughts on it. https://github.com/the-grid/TruncationBug-AsyncDisplayKitPlayground |
@appleguy Also you asked if this is a regression. Unfortunately I can't say, because I noticed it in a completely new app design approach, which is full stack ASDK using |
Thought of one more thing... in testing this I did notice that even calling measure on the node at a very late |
Initial PR was reverted. Will reopen. |
Struggling with a similar issue. Have a look at attached screenshots. Please suggest a solution https://user-images.githubusercontent.com/3315175/44842123-ab915100-ac62-11e8-8c36-d4168cc1ea37.png |
- Followup to facebookarchive#1742 - At Pinterest this shipped with D516974 in late 02/2020 - As discussed in facebookarchive#858 this is iOS10 or later, so the runtime `gMutex_unfair` check is still necessary for Texture.
ASCollectionNode, with ASCellNodes
Please note there is no cell re-use. They look similar (aside from background images) for testing purposes. This reproduces with any string that gets truncated at smaller cell sizes.
Layout approach is pure
layoutSpecThatFits
from rootASCellNode
down the view hierarchy.In overriding
visibilityDidChange
I can see that theconstrainedSize
is correct for every node, including the text nodes that have the incorrect truncation. Thebounds
, however, are incorrect for the truncated text nodes.After the resize transition, many nodes are properly laid out. When you scroll you eventually hit cells that have the
ASTextNode
truncating theNSAttributedString
to the same place as it was previous to the resize.This happens regardless of text formatting or otherwise, and can be reproduced with a plain
NSAttributedString
.In summary, if a
ASTextNode
has ever been truncated, it can appear again truncated with a largerconstrainedSize
, as if it was cached and reused or something. Important to note that this seems to happen for cells that are well out of any buffer ranges.The text was updated successfully, but these errors were encountered: