ASCellNode with shouldRasterizeDescendants does not call layout() on subnodes.
Hi,
I have a class that extends ASCellNode that sets shouldRasterizeDescendants to true. When adding a subnode to the class, layout() is never called on the subnode.
Is this intended or is there something I'm doing wrong? calculateSizeThatFits() on the subnode is called and so is drawRect(). If I call layout() manually in the cell node's layout() method, everything works fine.
@ajk198 Thanks for the report — I think this is a real issue. Because shouldRasterize being YES allows the system to avoid allocating any layers or views for that tree (can be a huge savings), there aren't any backing objects to call layout. This was not a problem for Paper's layout system, but clearly is for most apps!
The workaround you described is completely safe, and essentially the same thing that a system fix will do. We just need to install -layout calls in the logic that already recursively visits each node during rasterization.
Thanks for getting back to me. I can imagine with as many animations as Paper uses, you wouldn't be able to use shouldRasterizeDescendants as much as a more "static" app.
@ajk198 that is a very correct observation that many people don't realize ;).
FWIW, with the current PR in flight relating to layout mechanics, this has a real chance of being fixed soon. It will not be that terribly hard to add a recursive "-layoutIfNeeded" sort of call to rasterized hierarchies.
This has ben fixed.
@ajk198 Sorry it took a long time to update this task - the bug was fixed quite some time ago. Please feel free to try the latest ASDK release (master is best at the moment) and please do file a new issue for any problems you encounter, whether related to this or otherwise!