diff --git a/src/EndLevelLayer.cpp b/src/EndLevelLayer.cpp index f49ccf9..ace52a8 100644 --- a/src/EndLevelLayer.cpp +++ b/src/EndLevelLayer.cpp @@ -200,8 +200,8 @@ class $modify(MyEndLevelLayer, EndLevelLayer) { const float contentHeight = newSprite->getContentHeight(); if (contentHeight < 36.5f) newSprite->setScale(36.5f / contentHeight); else if (contentHeight > 50.f) newSprite->setScaleY(50.f / contentHeight); - const float contentWidth = newSprite->getContentWidth() * newSprite->getScaleX(); - if (contentWidth > 400.f) newSprite->setScaleX(400.f / contentWidth); + const float contentWidth = newSprite->getContentWidth(); + if (contentWidth * newSprite->getScaleX() > 400.f) newSprite->setScaleX(400.f / contentWidth); } } else if (manager->chosenMode == "Oxygene One" && !manager->sharedReplacementLabel.empty()) { CCLabelBMFont* newLabel = CCLabelBMFont::create(manager->sharedReplacementLabel.c_str(), "levelCompleteFont.fnt"_spr); diff --git a/src/PlayLayer.cpp b/src/PlayLayer.cpp index b906fca..5e453d0 100644 --- a/src/PlayLayer.cpp +++ b/src/PlayLayer.cpp @@ -54,8 +54,8 @@ class $modify(MyPlayLayer, PlayLayer) { const float contentHeight = newSprite->getContentHeight(); if (contentHeight < 36.5f) newSprite->setScale(36.5f / contentHeight); else if (contentHeight > 150.f) newSprite->setScaleY(150.f / contentHeight); - const float contentWidth = newSprite->getContentWidth() * newSprite->getScaleX(); - if (contentWidth > 400.f) newSprite->setScaleX(400.f / contentWidth); + const float contentWidth = newSprite->getContentWidth(); + if (contentWidth * newSprite->getScaleX() > 400.f) newSprite->setScaleX(400.f / contentWidth); } lctReplaced = true; }