diff --git a/res/layouts/code_editor.xml b/res/layouts/code_editor.xml index 4b61c4d8..b3cd2ed9 100644 --- a/res/layouts/code_editor.xml +++ b/res/layouts/code_editor.xml @@ -17,7 +17,7 @@ color="#FFFFFF80" size="16" pos="4,6" hover-color="#1080FF"> + size="76,24" padding="8" interval="8" color="0"> setPos(glm::vec2(ex, y)); - float width = size.x - padding.x - padding.z - margin.x - margin.z; + int width = glm::floor( + size.x - padding.x - padding.z - margin.x - margin.z + ); if (node->isResizing()) { node->setMaxSize({width, node->getMaxSize().y}); node->setSize(glm::vec2(width, node->getSize().y)); diff --git a/src/graphics/ui/gui_xml.cpp b/src/graphics/ui/gui_xml.cpp index 3e8bcf5d..11e0e860 100644 --- a/src/graphics/ui/gui_xml.cpp +++ b/src/graphics/ui/gui_xml.cpp @@ -244,10 +244,7 @@ static void read_base_panel_impl( if (element.has("padding")) { 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 - )); + panel.refresh(); } if (element.has("orientation")) { auto& oname = element.attr("orientation").getText();