mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
UiXmlReader padding fix
This commit is contained in:
parent
6fc312b651
commit
bb1743105d
2 changed files with 9 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue