mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add some codes, returnes directly if the value is not changed.
Avoid executing the following value-changed logics if the value does not really change.
This commit is contained in:
@@ -130,6 +130,11 @@ bool MenuButton::is_switch_on_hover() {
|
||||
|
||||
void MenuButton::set_item_count(int p_count) {
|
||||
ERR_FAIL_COND(p_count < 0);
|
||||
|
||||
if (popup->get_item_count() == p_count) {
|
||||
return;
|
||||
}
|
||||
|
||||
popup->set_item_count(p_count);
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user