Skip to content

Commit 7673049

Browse files
committed
update ready
1 parent 6a89dda commit 7673049

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

src/Labels/Nodes/ImageNode.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ void ImageNode::labelConfigUpdated()
1010

1111
sprite = CCSprite::create(config.imageLocation.c_str());
1212

13+
#if GEODE_COMP_GD_VERSION >= 22081
14+
if (sprite && sprite->isUsingFallback())
15+
sprite = nullptr;
16+
#endif
17+
18+
if (sprite && sprite->getUserObject("geode.texture-loader/fallback"))
19+
sprite = nullptr;
20+
1321
if (!sprite)
1422
{
1523
sprite = CCSprite::create("sog.png"_spr);

src/Labels/Nodes/LabelContainerLayer.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,16 @@ void LabelContainerLayer::sortNodeChildren(CCNode* node)
115115

116116
n->setPositionX(bb.size.width * modX);
117117

118+
float yInc = n->boundingBox().size.height;
119+
118120
if (node->getAnchorPoint().y == 0)
119-
n->setPositionY(y - (height * node->getAnchorPoint().y));
121+
n->setPositionY(y - (height * node->getAnchorPoint().y) + yInc / 2);
120122
else if (node->getAnchorPoint().y == 0.5f)
121-
n->setPositionY((height / 2) - y);
123+
n->setPositionY((height / 2) - y - yInc / 2);
122124
else
123-
n->setPositionY(-y);
125+
n->setPositionY(-y - yInc / 2);
124126

125-
y += n->boundingBox().size.height;
127+
y += yInc;
126128
}
127129
}
128130

src/Labels/UI/SetupLabelConfigUI.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,13 @@ void SetupLabelConfigUI::createPage1()
208208
opacityLine->setRotation(90);
209209
opacityLine->setScaleY(0.9f);
210210

211+
auto rotationTitle = CCLabelBMFont::create("Rotation", "bigFont.fnt");
212+
rotationTitle->setScale(0.5f);
213+
214+
auto rotationLine = CCSprite::createWithSpriteFrameName("edit_vLine_001.png");
215+
rotationLine->setRotation(90);
216+
rotationLine->setScaleY(0.9f);
217+
211218
nameInp = TextInput::create(145, "Display Name", "bigFont.fnt");
212219
nameInp->setScale(0.7f);
213220
nameInp->setCommonFilter(CommonFilter::Any);
@@ -260,6 +267,8 @@ void SetupLabelConfigUI::createPage1()
260267
pages[0]->addChildAtPosition(scaleLine, Anchor::Left, ccp(20 + infoBG->getScaledContentWidth() / 2, 18 - 13));
261268
pages[0]->addChildAtPosition(opacityTitle, Anchor::Left, ccp(20 + infoBG->getScaledContentWidth() / 2, -38));
262269
pages[0]->addChildAtPosition(opacityLine, Anchor::Left, ccp(20 + infoBG->getScaledContentWidth() / 2, -38 - 13));
270+
pages[0]->addChildAtPosition(rotationTitle, Anchor::Left, ccp(20 + infoBG->getScaledContentWidth() / 2, -38 - 56));
271+
pages[0]->addChildAtPosition(rotationLine, Anchor::Left, ccp(20 + infoBG->getScaledContentWidth() / 2, -38 - 13 - 56));
263272

264273
pages[0]->addChildAtPosition(generalBG, Anchor::Center, ccp(12.5f, 0));
265274
pages[0]->addChildAtPosition(fontBtn, Anchor::Center, ccp(12.5f, -65));
@@ -710,6 +719,9 @@ void SetupLabelConfigUI::updateImagePreview()
710719
imagePreview = nullptr;
711720
#endif
712721

722+
if (imagePreview && imagePreview->getUserObject("geode.texture-loader/fallback"))
723+
imagePreview = nullptr;
724+
713725
if (!imagePreview)
714726
{
715727
imagePreview = CCSprite::create("sog.png"_spr);

0 commit comments

Comments
 (0)