UiXmlReader padding fix
This commit is contained in:
parent
6fc312b651
commit
bb1743105d
@ -1,4 +1,4 @@
|
||||
<inventory color="#00000080" size="400,100">
|
||||
<inventory color="#00000080" size="400,0">
|
||||
<slots-grid cols="4" count="40"/>
|
||||
<button coord="300,10">Test</button>
|
||||
<button padding="10,10,10,10" coord="300,10">Test</button>
|
||||
</inventory>
|
||||
|
||||
@ -69,7 +69,13 @@ static void _readPanel(UiXmlReader& reader, xml::xmlelement element, Panel& pane
|
||||
_readUINode(element, panel);
|
||||
|
||||
if (element->has("padding")) {
|
||||
panel.setPadding(element->attr("padding").asVec4());
|
||||
glm::vec4 padding = element->attr("padding").asVec4();
|
||||
panel.setPadding(padding);
|
||||
glm::vec2 size = panel.getSize();
|
||||
panel.setSize(glm::vec2(
|
||||
size.x + padding.x + padding.z,
|
||||
size.y + padding.y + padding.w
|
||||
));
|
||||
}
|
||||
if (element->has("size")) {
|
||||
panel.setResizing(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user