Skip to content

Commit

Permalink
fix invisible/misaligned clear text btn
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jun 26, 2024
1 parent 0bd9bdb commit 6a78b3e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"geode": "3.1.0",
"geode": "3.1.1",
"gd": {
"win": "2.206",
"android": "2.206",
Expand Down
10 changes: 8 additions & 2 deletions src/CustomizeObjectLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6a78b3e

Please sign in to comment.