align to horizontal_alignment, valign to vertical_alignment, related

This commit is contained in:
Nathan Franke
2021-11-24 20:58:47 -06:00
parent f1e3c87244
commit 41a20171eb
130 changed files with 861 additions and 1011 deletions

View File

@ -60,12 +60,12 @@ void AspectRatioContainer::set_stretch_mode(StretchMode p_mode) {
queue_sort();
}
void AspectRatioContainer::set_alignment_horizontal(AlignMode p_alignment_horizontal) {
void AspectRatioContainer::set_alignment_horizontal(AlignmentMode p_alignment_horizontal) {
alignment_horizontal = p_alignment_horizontal;
queue_sort();
}
void AspectRatioContainer::set_alignment_vertical(AlignMode p_alignment_vertical) {
void AspectRatioContainer::set_alignment_vertical(AlignmentMode p_alignment_vertical) {
alignment_vertical = p_alignment_vertical;
queue_sort();
}
@ -107,25 +107,25 @@ void AspectRatioContainer::_notification(int p_what) {
float align_x = 0.5;
switch (alignment_horizontal) {
case ALIGN_BEGIN: {
case ALIGNMENT_BEGIN: {
align_x = 0.0;
} break;
case ALIGN_CENTER: {
case ALIGNMENT_CENTER: {
align_x = 0.5;
} break;
case ALIGN_END: {
case ALIGNMENT_END: {
align_x = 1.0;
} break;
}
float align_y = 0.5;
switch (alignment_vertical) {
case ALIGN_BEGIN: {
case ALIGNMENT_BEGIN: {
align_y = 0.0;
} break;
case ALIGN_CENTER: {
case ALIGNMENT_CENTER: {
align_y = 0.5;
} break;
case ALIGN_END: {
case ALIGNMENT_END: {
align_y = 1.0;
} break;
}
@ -166,7 +166,7 @@ void AspectRatioContainer::_bind_methods() {
BIND_ENUM_CONSTANT(STRETCH_FIT);
BIND_ENUM_CONSTANT(STRETCH_COVER);
BIND_ENUM_CONSTANT(ALIGN_BEGIN);
BIND_ENUM_CONSTANT(ALIGN_CENTER);
BIND_ENUM_CONSTANT(ALIGN_END);
BIND_ENUM_CONSTANT(ALIGNMENT_BEGIN);
BIND_ENUM_CONSTANT(ALIGNMENT_CENTER);
BIND_ENUM_CONSTANT(ALIGNMENT_END);
}