add shortcuts, node text font attributes
This commit is contained in:
@@ -60,6 +60,7 @@ void NodeText::set_font_size(int size)
|
||||
void NodeText::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* attr)
|
||||
{
|
||||
Node::parse_attributes(ka, attr);
|
||||
std::string id = attr->Name();
|
||||
switch (ka)
|
||||
{
|
||||
case kAttribute::Multiline:
|
||||
@@ -106,6 +107,12 @@ void NodeText::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* att
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (id == "size")
|
||||
m_font_size = attr->IntValue();
|
||||
else if (id == "weight")
|
||||
m_font_weight = attr->Value();
|
||||
else if (id == "italic")
|
||||
m_font_italic = attr->BoolValue();
|
||||
}
|
||||
|
||||
void NodeText::set_text(const std::string& s)
|
||||
|
||||
Reference in New Issue
Block a user