Skip to content

Commit 93e271e

Browse files
committed
Fixes
1 parent df6ddc0 commit 93e271e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/UIModding.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ void UIModding::setScale(CCNode* node, const matjson::Value& attributes) {
12501250

12511251
if (auto fit = scale["fit"]; fit.isObject()) {
12521252
std::string fitRelative = fit["relative"].asString().unwrapOrDefault();
1253-
float scaleOffset = fit["relative"].asDouble().unwrapOr(1.f);
1253+
float scaleMultiplier = fit["multiplier"].asDouble().unwrapOr(1.f);
12541254
CCSize targetSize = {-1, -1};
12551255
CCSize screenSize = CCDirector::get()->getWinSize();
12561256
CCSize parentSize = targetSize;
@@ -1276,11 +1276,11 @@ void UIModding::setScale(CCNode* node, const matjson::Value& attributes) {
12761276
targetSize.height = parentSize.height;
12771277
}
12781278
if (fitRelative == "size") {
1279-
if (auto size = scale["size"]; fit.isObject()) {
1280-
if (auto widthVal = scale["width"]; widthVal.isNumber()) {
1279+
if (auto size = fit["size"]; fit.isObject()) {
1280+
if (auto widthVal = size["width"]; widthVal.isNumber()) {
12811281
targetSize.width = widthVal.asDouble().unwrapOr(-1.f);
12821282
}
1283-
if (auto heightVal = scale["height"]; heightVal.isNumber()) {
1283+
if (auto heightVal = size["height"]; heightVal.isNumber()) {
12841284
targetSize.height = heightVal.asDouble().unwrapOr(-1.f);
12851285
}
12861286
}
@@ -1312,7 +1312,7 @@ void UIModding::setScale(CCNode* node, const matjson::Value& attributes) {
13121312

13131313
if (largestSide != -1) {
13141314
float scale = largestSide / largestContentSide;
1315-
node->setScale(scale);
1315+
node->setScale(scale * scaleMultiplier);
13161316
}
13171317
return;
13181318
}

0 commit comments

Comments
 (0)