From 5b815f2174ff460427056372de96bf42e3923a6f Mon Sep 17 00:00:00 2001 From: Alphalaneous <38200084+Alphalaneous@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:28:30 -0400 Subject: [PATCH 1/2] Fix y position of everything --- src/features/scaling/EditorUIScaling.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/features/scaling/EditorUIScaling.cpp b/src/features/scaling/EditorUIScaling.cpp index 41b6cb5..b82ddeb 100644 --- a/src/features/scaling/EditorUIScaling.cpp +++ b/src/features/scaling/EditorUIScaling.cpp @@ -63,7 +63,6 @@ class $modify(BetterEditButtonBar, EditButtonBar) { navMenu->setScale(menu->getScale()); float xOffset = (winSize.width / getScale())/2 - 104; - float yOffset = 2; CCSprite* prevSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png"); prevSpr->setScale(0.6f); @@ -75,10 +74,10 @@ class $modify(BetterEditButtonBar, EditButtonBar) { CCMenuItemSpriteExtra* nextButton = CCMenuItemSpriteExtra::create(nextSpr, this, menu_selector(EditButtonBar::onRight)); prevButton->setPositionX(menu->getContentWidth()/2 - xOffset); - prevButton->setPositionY((ui->m_toolbarHeight/2 + yOffset) / getScale()); + prevButton->setPositionY((ui->m_toolbarHeight/2) / getScale()); nextButton->setPositionX(menu->getContentWidth()/2 + xOffset); - nextButton->setPositionY((ui->m_toolbarHeight/2 + yOffset) / getScale()); + nextButton->setPositionY((ui->m_toolbarHeight/2) / getScale()); navMenu->addChild(prevButton); navMenu->addChild(nextButton); @@ -102,7 +101,7 @@ class $modify(BetterEditButtonBar, EditButtonBar) { buttonMenu->setContentSize({width, height}); buttonMenu->setAnchorPoint({0.5, 1}); - buttonMenu->setPositionY(ui->m_toolbarHeight / getScale() - 5); + buttonMenu->setPositionY(ui->m_toolbarHeight / getScale() - 7); buttonMenu->updateLayout(); float outerWidth = (winSize.width / getScale()) - 235; From a4673d45c1967d099d1aa6478ebb08d7a0ae9858 Mon Sep 17 00:00:00 2001 From: Alphalaneous <38200084+Alphalaneous@users.noreply.github.com> Date: Tue, 22 Oct 2024 18:33:58 -0400 Subject: [PATCH 2/2] Fix arrow buttons position to be not as close to edge --- src/features/scaling/EditorUIScaling.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/scaling/EditorUIScaling.cpp b/src/features/scaling/EditorUIScaling.cpp index b82ddeb..45bd47d 100644 --- a/src/features/scaling/EditorUIScaling.cpp +++ b/src/features/scaling/EditorUIScaling.cpp @@ -62,7 +62,7 @@ class $modify(BetterEditButtonBar, EditButtonBar) { navMenu->setContentSize(menu->getContentSize()); navMenu->setScale(menu->getScale()); - float xOffset = (winSize.width / getScale())/2 - 104; + float xOffset = (winSize.width / getScale())/2 - 108; CCSprite* prevSpr = CCSprite::createWithSpriteFrameName("GJ_arrow_02_001.png"); prevSpr->setScale(0.6f); @@ -104,7 +104,7 @@ class $modify(BetterEditButtonBar, EditButtonBar) { buttonMenu->setPositionY(ui->m_toolbarHeight / getScale() - 7); buttonMenu->updateLayout(); - float outerWidth = (winSize.width / getScale()) - 235; + float outerWidth = (winSize.width / getScale()) - 240; float outerHeight = (ui->m_toolbarHeight / getScale()) - 15; float scaleW = outerWidth / width; float scaleH = outerHeight / height;