61 Frame2D(T width=0, T height=0) : width(this->next()), height(this->next()){
62 this->set(width, height?height:width);
66 this->set(geometry.width, geometry.height);
71 this->set(geometry.width, geometry.height);
76 this->set(tuple[0], tuple[1]);
93 this->set(geometry.width, geometry.height);
101 Frame2D & operator=(
const T2 & frame){
121 void setArea(T w, T h){
140 T getHeight()
const {
151 return (width==0) || (height==0);
234 Box(coord_t x=0, coord_t y=0, coord_t width=0, coord_t height=0) :
242 Box & operator=(
const Box &) =
default;
249 this->setLocation(undefined, undefined);
253 void expand(coord_t x, coord_t y){
272 void expandHorz(
const Box & box){
274 expandHorz(box.x + box.width);
279 void expandVert(
const Box & box){
281 expandVert(box.y + box.height);
284 void expandHorz(coord_t x){
286 if (!isUndefined(this->x)){
287 const coord_t xMax = std::max(x, this->x + this->width);
288 this->x = std::min(this->x, x);
289 this->width = xMax - this->x;
297 void expandVert(coord_t y){
299 if (!isUndefined(this->y)){
300 const coord_t yMax = std::max(y, this->y + this->height);
301 this->y = std::min(this->y, y);
302 this->height = yMax - this->y;
329 bool isDefined()
const {
330 return isDefined(this->x) && isDefined(this->y) && isDefined(this->width) && isDefined(this->height);
335 bool isDefined(coord_t coord){
336 return !std::isnan(coord);
340 bool isUndefined(coord_t coord){
341 return std::isnan(coord);