diff options
author | kobewi <kobewi4e@gmail.com> | 2022-05-09 18:51:13 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2022-05-09 18:51:13 +0200 |
commit | 20cfe6e229a331bc0aedc17be04330c6fe125bbe (patch) | |
tree | f0202c4d5bdc6d34a7790f9a000234a5b446a43c | |
parent | 168edcd3763b8154fbf86149fa33d5be5347d3e9 (diff) |
Simplify anchor metadata
-rw-r--r-- | scene/gui/control.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index dddeec5610..54fa726260 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1590,22 +1590,22 @@ void Control::set_anchor_and_offset(Side p_side, real_t p_anchor, real_t p_pos, void Control::_set_anchors_layout_preset(int p_preset) { bool list_changed = false; - if (has_meta("_edit_layout_mode") && (int)get_meta("_edit_layout_mode") != (int)LayoutMode::LAYOUT_MODE_ANCHORS) { + if (get_meta("_edit_layout_mode", LayoutMode::LAYOUT_MODE_ANCHORS).operator int() != LayoutMode::LAYOUT_MODE_ANCHORS) { list_changed = true; - set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS); + set_meta("_edit_layout_mode", LayoutMode::LAYOUT_MODE_ANCHORS); } if (p_preset == -1) { - if (!has_meta("_edit_use_custom_anchors") || !(bool)get_meta("_edit_use_custom_anchors")) { + if (!get_meta("_edit_use_custom_anchors", false)) { set_meta("_edit_use_custom_anchors", true); notify_property_list_changed(); } return; // Keep settings as is. } - if (!has_meta("_edit_use_custom_anchors") || (bool)get_meta("_edit_use_custom_anchors")) { + if (get_meta("_edit_use_custom_anchors", true)) { list_changed = true; - set_meta("_edit_use_custom_anchors", false); + remove_meta("_edit_use_custom_anchors"); } LayoutPreset preset = (LayoutPreset)p_preset; |