2#include "Container.hpp"
4Container::Container(
int layout,
int padding)
8 this->padding = padding;
13 int newPosX = (layout == ROW_LAYOUT) ? this->
width + padding : this->x;
14 int newPosY = (layout == COL_LAYOUT) ? this->height + padding : this->y;
16 child(elem->setPosition(newPosX, newPosY));
18 this->
width = (layout == ROW_LAYOUT) ? this->
width + elem->
width + padding : std::max(this->width, elem->
width);
19 this->height = (layout == COL_LAYOUT) ? this->height + elem->height + padding : std::max(this->height, elem->height);
int width
width and height of this element (must be manually set, isn't usually calculated (but is in some case...