feat(ui): introduce anchor-based widget positioning system

Replace set_position with anchor and offset for relative positioning. Add parent pointer to widget hierarchy. Remove manual resize logic in UI managers.
This commit is contained in:
2026-07-13 14:52:35 +08:00
parent 0cbb353a2a
commit f5e53fd13d
14 changed files with 241 additions and 114 deletions

View File

@@ -3,8 +3,8 @@
#include "Cubed/render/renderer.hpp"
#include "Cubed/tools/font.hpp"
namespace Cubed {
Label::Label(const std::string& id) : Widget(id) {}
Label::Label() {}
Label::Label(const std::string& id, Widget* parent) : Widget(id, parent) {}
Label::Label(Widget* parent) : Widget(parent) {}
Label& Label::set_text(std::string_view text) {
m_text.text = text;
update_vertices();