summaryrefslogtreecommitdiff
path: root/scene/gui/container.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/container.cpp')
-rw-r--r--scene/gui/container.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index 8d25195199..145074a626 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -104,22 +104,22 @@ void Container::fit_child_in_rect(Control *p_child, const Rect2 &p_rect) {
Size2 minsize = p_child->get_combined_minimum_size();
Rect2 r = p_rect;
- if (!(p_child->get_h_size_flags() & SIZE_FILL)) {
+ if (!(p_child->get_h_size_flags().has_flag(SIZE_FILL))) {
r.size.x = minsize.width;
- if (p_child->get_h_size_flags() & SIZE_SHRINK_END) {
+ if (p_child->get_h_size_flags().has_flag(SIZE_SHRINK_END)) {
r.position.x += rtl ? 0 : (p_rect.size.width - minsize.width);
- } else if (p_child->get_h_size_flags() & SIZE_SHRINK_CENTER) {
+ } else if (p_child->get_h_size_flags().has_flag(SIZE_SHRINK_CENTER)) {
r.position.x += Math::floor((p_rect.size.x - minsize.width) / 2);
} else {
r.position.x += rtl ? (p_rect.size.width - minsize.width) : 0;
}
}
- if (!(p_child->get_v_size_flags() & SIZE_FILL)) {
+ if (!(p_child->get_v_size_flags().has_flag(SIZE_FILL))) {
r.size.y = minsize.y;
- if (p_child->get_v_size_flags() & SIZE_SHRINK_END) {
+ if (p_child->get_v_size_flags().has_flag(SIZE_SHRINK_END)) {
r.position.y += p_rect.size.height - minsize.height;
- } else if (p_child->get_v_size_flags() & SIZE_SHRINK_CENTER) {
+ } else if (p_child->get_v_size_flags().has_flag(SIZE_SHRINK_CENTER)) {
r.position.y += Math::floor((p_rect.size.y - minsize.height) / 2);
} else {
r.position.y += 0;