mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-29 10:55:47 -05:00
Merge branch 'main' into settings
This commit is contained in:
commit
ddf27910fb
2 changed files with 10 additions and 4 deletions
|
@ -256,6 +256,12 @@ namespace geode {
|
||||||
}
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Completely disregard the result. Only recommended if the result is
|
||||||
|
* inconsequential
|
||||||
|
*/
|
||||||
|
constexpr void disregard() && {}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T = impl::DefaultValue>
|
template <class T = impl::DefaultValue>
|
||||||
|
|
|
@ -29,11 +29,11 @@ void ScrollLayer::visit() {
|
||||||
glEnable(GL_SCISSOR_TEST);
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
if (this->getParent()) {
|
if (this->getParent()) {
|
||||||
CCPoint const offset = this->isIgnoreAnchorPointForPosition()
|
// CCPoint const offset = this->isIgnoreAnchorPointForPosition()
|
||||||
? ccp(0, 0) : CCPoint(this->getContentSize() * -this->getAnchorPoint());
|
// ? ccp(0, 0) : CCPoint(this->getContentSize() * -this->getAnchorPoint());
|
||||||
|
|
||||||
auto const bottomLeft = this->convertToWorldSpace(ccp(0, 0) - offset);
|
auto const bottomLeft = this->convertToWorldSpace(ccp(0, 0));
|
||||||
auto const topRight = this->convertToWorldSpace(this->getContentSize() - offset);
|
auto const topRight = this->convertToWorldSpace(this->getContentSize());
|
||||||
CCSize const size = topRight - bottomLeft;
|
CCSize const size = topRight - bottomLeft;
|
||||||
|
|
||||||
CCEGLView::get()->setScissorInPoints(bottomLeft.x, bottomLeft.y, size.width, size.height);
|
CCEGLView::get()->setScissorInPoints(bottomLeft.x, bottomLeft.y, size.width, size.height);
|
||||||
|
|
Loading…
Reference in a new issue