mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user