Skip to content

Commit f03cee8

Browse files
committed
fix improper scrolllayer culling when it has children with y scale not set to 1
1 parent 28e078d commit f03cee8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

loader/src/ui/nodes/ScrollLayer.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ void GenericContentLayer::setPosition(CCPoint const& pos) {
2626
for (auto child : CCArrayExt<CCNode*>(m_pChildren)) {
2727
float childY = this->getPositionY() + child->getPositionY();
2828
auto anchor = child->isIgnoreAnchorPointForPosition() ? CCPoint{ 0, 0 } : child->getAnchorPoint();
29-
float childTop = childY + (1.f - anchor.y) * child->getScaledContentSize().height;
30-
float childBottom = childY - child->getAnchorPoint().y * child->getScaledContentSize().height;
29+
float scaleY = child->getScaleY();
30+
float childTop = scaleY * (childY + (1.f - anchor.y) * child->getScaledContentSize().height);
31+
float childBottom = scaleY * (childY - child->getAnchorPoint().y * child->getScaledContentSize().height);
3132
bool visible = childTop > 0 && childBottom < scrollLayerSize.height;
3233

3334
child->setVisible(visible);

0 commit comments

Comments
 (0)