feat(ui): add Rect widget with fill, color, and parent-relative sizing

This commit is contained in:
2026-07-13 20:48:51 +08:00
parent acb0b94d7b
commit 80ba6dad89
15 changed files with 215 additions and 42 deletions

View File

@@ -9,6 +9,19 @@ void ColumnLayout::update(float dt) {
layout();
}
float ColumnLayout::width() const {
if (m_parent) {
return m_parent->width();
}
return m_window_width;
}
float ColumnLayout::height() const {
if (m_parent) {
return m_parent->height();
}
return m_window_height;
}
void ColumnLayout::set_spacing(int spacing) { m_spacing = spacing; }
void ColumnLayout::layout() {