From 135de4a5e332c9ca52efd6e7366dc8ea1afb8309 Mon Sep 17 00:00:00 2001 From: Explodingbill Date: Tue, 27 Feb 2024 19:42:10 +1100 Subject: [PATCH] mac os --- src/CCLabelBMFontExt.h | 11 +++++++++++ src/main.cpp | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/CCLabelBMFontExt.h b/src/CCLabelBMFontExt.h index 0236e29..02cc189 100644 --- a/src/CCLabelBMFontExt.h +++ b/src/CCLabelBMFontExt.h @@ -336,6 +336,17 @@ class CCLabelBMFontExt : public CCMenu updateLabel(); } + float clampf(float v, float min, float max) + { + if (v < min) + v = min; + + if (v > max) + v = max; + + return v; + } + void limitLabelWidth(float width, float defaultScale, float minScale) { this->setScale(clampf(width / this->getContentSize().width, minScale, defaultScale)); diff --git a/src/main.cpp b/src/main.cpp index 34e26ab..5b9dcac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -74,6 +74,19 @@ class $modify (ShareCommentLayerExt, ShareCommentLayer) auto menu = m_fields->commentMenu; menu->stopAllActions(); + #ifdef GEODE_IS_MACOS + + if (m_fields->visible) + { + menu->runAction((CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width, 0)))); + } + else + { + menu->runAction((CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width + menu->getContentSize().width, 0)))); + } + + #else + if (m_fields->visible) { menu->runAction(CCEaseInOut::create(CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width, 0)), 2)); @@ -82,6 +95,8 @@ class $modify (ShareCommentLayerExt, ShareCommentLayer) { menu->runAction(CCEaseInOut::create(CCMoveTo::create(0.75f, ccp(CCDirector::get()->getWinSize().width + menu->getContentSize().width, 0)), 2)); } + + #endif } void onSelectEmoji(CCObject* sender)