#include <Widget/Layout/CompoundWidget/CompoundWidget.hpp>

CompoundWidget::CompoundWidget(Widget *child) : Layout(child) {}

void CompoundWidget::layout()
{
    m_children.begin()->widget->onResize(m_size);
}

glm::ivec2 CompoundWidget::getMinSize()
{
    return m_children.begin()->widget->getMinSize();
}

void CompoundWidget::draw(GraphicsContext &context)
{
    m_children.begin()->widget->widgetAbsPos = widgetAbsPos;
    Layout::draw(context);
}