From 6a78b3ec546c9b7e77358b40a15a654307970dfb Mon Sep 17 00:00:00 2001 From: Cvolton Date: Wed, 26 Jun 2024 10:37:32 +0200 Subject: [PATCH] fix invisible/misaligned clear text btn --- mod.json | 2 +- src/CustomizeObjectLayer.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mod.json b/mod.json index 5bb6c13..a198c3d 100644 --- a/mod.json +++ b/mod.json @@ -1,5 +1,5 @@ { - "geode": "3.1.0", + "geode": "3.1.1", "gd": { "win": "2.206", "android": "2.206", diff --git a/src/CustomizeObjectLayer.cpp b/src/CustomizeObjectLayer.cpp index f804e26..7e39b3a 100644 --- a/src/CustomizeObjectLayer.cpp +++ b/src/CustomizeObjectLayer.cpp @@ -229,12 +229,18 @@ using namespace geode::node_ids; textActionsMenu->setPositionX(winSize.width / 2 + 110.f); textActionsMenu->updateLayout(); - auto clearTextMenu = detachAndCreateMenu( + if(auto clearTextMenu = detachAndCreateMenu( m_mainLayer, "clear-text-menu", nullptr, m_buttonMenu->getChildByID("clear-text-button") - ); + )) { + //the position being incorrect has something to do with anchor points and ignoreAnchorPointForPosition + //if the anchor point of the menu was {1,0} and it actually worked, it'd be correct + //but that's not what's happening so whatever + //dont care enough, this fixes it + if(auto btn = clearTextMenu->getChildByID("clear-text-button")) btn->setPosition({winSize / 2}); + } auto infoMenu = detachAndCreateMenu( m_mainLayer,