Skip to content

Commit

Permalink
Merge pull request #60905 from KoBeWi/⚓
Browse files Browse the repository at this point in the history
Simplify anchor metadata
  • Loading branch information
akien-mga authored May 9, 2022
2 parents 033e211 + 20cfe6e commit e3371a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e3371a5

Please sign in to comment.