From 8cc51a107e27e1cb5ae8343fa0151db9c9a66852 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 25 Nov 2025 21:54:58 +0300 Subject: [PATCH 1/2] fix: panel width differs to size specified in xml --- src/graphics/ui/elements/Panel.cpp | 4 +++- src/graphics/ui/gui_xml.cpp | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/graphics/ui/elements/Panel.cpp b/src/graphics/ui/elements/Panel.cpp index 945c45e7..ed9af66c 100644 --- a/src/graphics/ui/elements/Panel.cpp +++ b/src/graphics/ui/elements/Panel.cpp @@ -81,7 +81,9 @@ void Panel::refresh() { float ex = x + margin.x; node->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(); From a14f85a0a939843434537d1813b6d9e675f9b47d Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 25 Nov 2025 22:15:17 +0300 Subject: [PATCH 2/2] fix internal code editor --- res/layouts/code_editor.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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">