From d95a43be0b775a16f6c7de1daa9b3ae1619a2d3a Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:23:13 +0300 Subject: [PATCH 1/2] fix scroll layer when anchor point is not ignored --- loader/src/ui/nodes/ScrollLayer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader/src/ui/nodes/ScrollLayer.cpp b/loader/src/ui/nodes/ScrollLayer.cpp index f4aeca2b..5af4e493 100644 --- a/loader/src/ui/nodes/ScrollLayer.cpp +++ b/loader/src/ui/nodes/ScrollLayer.cpp @@ -29,11 +29,11 @@ void ScrollLayer::visit() { glEnable(GL_SCISSOR_TEST); if (this->getParent()) { - CCPoint const offset = this->isIgnoreAnchorPointForPosition() - ? ccp(0, 0) : CCPoint(this->getContentSize() * -this->getAnchorPoint()); + // CCPoint const offset = this->isIgnoreAnchorPointForPosition() + // ? ccp(0, 0) : CCPoint(this->getContentSize() * -this->getAnchorPoint()); - auto const bottomLeft = this->convertToWorldSpace(ccp(0, 0) - offset); - auto const topRight = this->convertToWorldSpace(this->getContentSize() - offset); + auto const bottomLeft = this->convertToWorldSpace(ccp(0, 0)); + auto const topRight = this->convertToWorldSpace(this->getContentSize()); CCSize const size = topRight - bottomLeft; CCEGLView::get()->setScissorInPoints(bottomLeft.x, bottomLeft.y, size.width, size.height); From c38f588dc7d187706dba0167b857f9414b908cc4 Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:02:31 -0500 Subject: [PATCH 2/2] add disregard --- loader/include/Geode/utils/Result.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/loader/include/Geode/utils/Result.hpp b/loader/include/Geode/utils/Result.hpp index dff90491..b7ce5f71 100644 --- a/loader/include/Geode/utils/Result.hpp +++ b/loader/include/Geode/utils/Result.hpp @@ -256,6 +256,12 @@ namespace geode { } return std::nullopt; } + + /** + * Completely disregard the result. Only recommended if the result is + * inconsequential + */ + constexpr void disregard() && {} }; template