added node alignment and text color
This commit is contained in:
@@ -127,6 +127,36 @@ void Node::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr)
|
||||
case kAttribute::FlexWrap:
|
||||
YGNodeStyleSetFlexWrap(y_node, attr->IntValue() ? YGWrapWrap : YGWrapNoWrap);
|
||||
break;
|
||||
case kAttribute::Justify:
|
||||
{
|
||||
YGJustify v = YGJustifyFlexStart;
|
||||
if (strcmp("center", attr->Value()) == 0)
|
||||
v = YGJustifyCenter;
|
||||
else if (strcmp("flex-start", attr->Value()) == 0)
|
||||
v = YGJustifyFlexStart;
|
||||
else if (strcmp("flex-end", attr->Value()) == 0)
|
||||
v = YGJustifyFlexEnd;
|
||||
else if (strcmp("space-around", attr->Value()) == 0)
|
||||
v = YGJustifySpaceAround;
|
||||
else if (strcmp("space-between", attr->Value()) == 0)
|
||||
v = YGJustifySpaceBetween;
|
||||
YGNodeStyleSetJustifyContent(y_node, v);
|
||||
break;
|
||||
}
|
||||
case kAttribute::Align:
|
||||
{
|
||||
YGAlign v = YGAlignStretch;
|
||||
if (strcmp("stretch", attr->Value()) == 0)
|
||||
v = YGAlignStretch;
|
||||
else if (strcmp("flex-start", attr->Value()) == 0)
|
||||
v = YGAlignFlexStart;
|
||||
else if (strcmp("flex-end", attr->Value()) == 0)
|
||||
v = YGAlignFlexEnd;
|
||||
else if (strcmp("center", attr->Value()) == 0)
|
||||
v = YGAlignCenter;
|
||||
YGNodeStyleSetAlignItems(y_node, v);
|
||||
break;
|
||||
}
|
||||
case kAttribute::Padding:
|
||||
{
|
||||
glm::vec4 pad;
|
||||
|
||||
Reference in New Issue
Block a user