Add 'full' screen element mode

This commit is contained in:
Nikita Lisitsa 2021-02-26 14:40:06 +03:00
parent d16a71012d
commit 4e027a2ec9
2 changed files with 8 additions and 0 deletions

View file

@ -14,6 +14,7 @@ namespace psemek::ui
left, left,
center, center,
right, right,
full,
floating, floating,
}; };
@ -22,6 +23,7 @@ namespace psemek::ui
top, top,
center, center,
bottom, bottom,
full,
floating, floating,
}; };

View file

@ -49,6 +49,9 @@ namespace psemek::ui
case x_policy::right: case x_policy::right:
cbox[0] = {bbox[0].max - size[0], bbox[0].max}; cbox[0] = {bbox[0].max - size[0], bbox[0].max};
break; break;
case x_policy::full:
cbox[0] = bbox[0];
break;
case x_policy::floating: case x_policy::floating:
cbox[0] = geom::expand(cbox[0], (size[0] - cbox[0].length()) / 2.f); cbox[0] = geom::expand(cbox[0], (size[0] - cbox[0].length()) / 2.f);
@ -70,6 +73,9 @@ namespace psemek::ui
case y_policy::bottom: case y_policy::bottom:
cbox[1] = {bbox[1].max - size[1], bbox[1].max}; cbox[1] = {bbox[1].max - size[1], bbox[1].max};
break; break;
case y_policy::full:
cbox[1] = bbox[1];
break;
case y_policy::floating: case y_policy::floating:
cbox[1] = geom::expand(cbox[1], (size[1] - cbox[1].length()) / 2.f); cbox[1] = geom::expand(cbox[1], (size[1] - cbox[1].length()) / 2.f);