diff --git a/src/coders/yaml.cpp b/src/coders/yaml.cpp index a9944ea3..b10d5ce2 100644 --- a/src/coders/yaml.cpp +++ b/src/coders/yaml.cpp @@ -308,7 +308,7 @@ dv::value Parser::parseObject(dv::value&& object, int indent) { object[std::string(name)] = parseFullValue(indent); skipEmptyLines(); } - return object; + return std::move(object); } dv::value yaml::parse(std::string_view filename, std::string_view source) { diff --git a/src/graphics/ui/elements/Button.cpp b/src/graphics/ui/elements/Button.cpp index bb531889..7600fbd0 100644 --- a/src/graphics/ui/elements/Button.cpp +++ b/src/graphics/ui/elements/Button.cpp @@ -34,14 +34,12 @@ Button::Button( const onaction& action, glm::vec2 size ) - : Panel(gui, size, padding, 0) { - if (size.y < 0.0f) { - size = glm::vec2( - glm::max(padding.x + padding.z + text.length() * 8, size.x), - glm::max(padding.y + padding.w + 16, size.y) - ); + : Panel(gui, size, padding, 0.0f) { + if (size.x < 0.0f || size.y < 0.0f) { + setContentSize({text.length() * 8, 16}); + } else { + setSize(size); } - setSize(size); if (action) { listenAction(action); @@ -50,13 +48,12 @@ Button::Button( label = std::make_shared