| 964 | nodeTop = nextTop; |
| 965 | } |
| 966 | return anchor; |
| 967 | } |
| 968 | |
| 969 | ViewNode* preserveFindDescendantById(ViewNode* node, RawViewNodeId id, int depth) { |
| 970 | // id 0 is the unset/default rawId (e.g. synthetic placeholder nodes); never "match" it, or |
| 971 | // we would anchor to the first id-less node (content top) and jump the viewport. |
| 972 | if (depth <= 0 || id == 0) |
| 973 | return nullptr; |
| 974 | for (auto* child : *node) { |
| 975 | if (child->getRawId() == id) |
| 976 | return child; |
| 977 | auto* found = preserveFindDescendantById(child, id, depth - 1); |
| 978 | if (found) |
| 979 | return found; |
| 980 | } |
| 981 | return nullptr; |
| 982 | } |
no test coverage detected