Limit inspector updates when dragging anchored controls
This commit is contained in:
parent
d3a6b6daaa
commit
ddc8ec6b44
1 changed files with 18 additions and 5 deletions
|
@ -1585,14 +1585,25 @@ 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) {
|
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) {
|
||||||
|
list_changed = true;
|
||||||
set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS);
|
set_meta("_edit_layout_mode", (int)LayoutMode::LAYOUT_MODE_ANCHORS);
|
||||||
|
}
|
||||||
|
|
||||||
if (p_preset == -1) {
|
if (p_preset == -1) {
|
||||||
|
if (!has_meta("_edit_use_custom_anchors") || !(bool)get_meta("_edit_use_custom_anchors")) {
|
||||||
set_meta("_edit_use_custom_anchors", true);
|
set_meta("_edit_use_custom_anchors", true);
|
||||||
notify_property_list_changed();
|
notify_property_list_changed();
|
||||||
|
}
|
||||||
return; // Keep settings as is.
|
return; // Keep settings as is.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!has_meta("_edit_use_custom_anchors") || (bool)get_meta("_edit_use_custom_anchors")) {
|
||||||
|
list_changed = true;
|
||||||
set_meta("_edit_use_custom_anchors", false);
|
set_meta("_edit_use_custom_anchors", false);
|
||||||
|
}
|
||||||
|
|
||||||
LayoutPreset preset = (LayoutPreset)p_preset;
|
LayoutPreset preset = (LayoutPreset)p_preset;
|
||||||
// Set correct anchors.
|
// Set correct anchors.
|
||||||
|
@ -1625,8 +1636,10 @@ void Control::_set_anchors_layout_preset(int p_preset) {
|
||||||
// Select correct grow directions.
|
// Select correct grow directions.
|
||||||
set_grow_direction_preset(preset);
|
set_grow_direction_preset(preset);
|
||||||
|
|
||||||
|
if (list_changed) {
|
||||||
notify_property_list_changed();
|
notify_property_list_changed();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int Control::_get_anchors_layout_preset() const {
|
int Control::_get_anchors_layout_preset() const {
|
||||||
// If the custom preset was selected by user, use it.
|
// If the custom preset was selected by user, use it.
|
||||||
|
|
Loading…
Reference in a new issue