Fixed crashing on empty string for UIRichTextLabel
This commit is contained in:
@ -22,9 +22,6 @@
|
|||||||
alignY="UI_COMPONENT_ALIGN_MIDDLE"
|
alignY="UI_COMPONENT_ALIGN_MIDDLE"
|
||||||
ref="uiLabel"
|
ref="uiLabel"
|
||||||
>
|
>
|
||||||
<font font="font_main" size="32">
|
|
||||||
Hello world!
|
|
||||||
</font>
|
|
||||||
</UIRichTextLabel>
|
</UIRichTextLabel>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ void UIRichTextLabel::onStart() {
|
|||||||
|
|
||||||
std::function<void(Xml*)> parseChildren = [&](Xml *node) {
|
std::function<void(Xml*)> parseChildren = [&](Xml *node) {
|
||||||
if(node->children.empty()) {
|
if(node->children.empty()) {
|
||||||
|
if(node->node == "root") return;
|
||||||
struct UILabelText text;
|
struct UILabelText text;
|
||||||
text.style = current;
|
text.style = current;
|
||||||
text.text = node->value;
|
text.text = node->value;
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
using namespace Dawn;
|
using namespace Dawn;
|
||||||
|
|
||||||
Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) {
|
Scene * Dawn::dawnGameGetInitialScene(DawnGame *game) {
|
||||||
return new HelloWorldScene(game);
|
// return new HelloWorldScene(game);
|
||||||
// return new Scene1Prologue(game);
|
return new Scene1Prologue(game);
|
||||||
}
|
}
|
Reference in New Issue
Block a user