mirror of
https://github.com/geode-sdk/geode.git
synced 2025-04-24 05:14:40 -04:00
fix scrolllayer culling being broken for nodes with ignoreAnchorPointForPosition
This commit is contained in:
parent
e7d6adeaff
commit
b733c3671f
1 changed files with 3 additions and 2 deletions
|
@ -25,10 +25,11 @@ void GenericContentLayer::setPosition(CCPoint const& pos) {
|
|||
|
||||
for (auto child : CCArrayExt<CCNode*>(m_pChildren)) {
|
||||
float childY = this->getPositionY() + child->getPositionY();
|
||||
float childTop = childY + (1.f - child->getAnchorPoint().y) * child->getScaledContentSize().height;
|
||||
auto anchor = child->isIgnoreAnchorPointForPosition() ? CCPoint{ 0, 0 } : child->getAnchorPoint();
|
||||
float childTop = childY + (1.f - anchor.y) * child->getScaledContentSize().height;
|
||||
float childBottom = childY - child->getAnchorPoint().y * child->getScaledContentSize().height;
|
||||
bool visible = childTop > 0 && childBottom < scrollLayerSize.height;
|
||||
|
||||
|
||||
child->setVisible(visible);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue