Skip to content

Commit b733c36

Browse files
committed
fix scrolllayer culling being broken for nodes with ignoreAnchorPointForPosition
1 parent e7d6ade commit b733c36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

loader/src/ui/nodes/ScrollLayer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ void GenericContentLayer::setPosition(CCPoint const& pos) {
2525

2626
for (auto child : CCArrayExt<CCNode*>(m_pChildren)) {
2727
float childY = this->getPositionY() + child->getPositionY();
28-
float childTop = childY + (1.f - child->getAnchorPoint().y) * child->getScaledContentSize().height;
28+
auto anchor = child->isIgnoreAnchorPointForPosition() ? CCPoint{ 0, 0 } : child->getAnchorPoint();
29+
float childTop = childY + (1.f - anchor.y) * child->getScaledContentSize().height;
2930
float childBottom = childY - child->getAnchorPoint().y * child->getScaledContentSize().height;
3031
bool visible = childTop > 0 && childBottom < scrollLayerSize.height;
31-
32+
3233
child->setVisible(visible);
3334
}
3435
}

0 commit comments

Comments
 (0)