summaryrefslogtreecommitdiffstats
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 49b30bd06e..fe50961b54 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -2645,7 +2645,7 @@ void EditorPropertyColor::_color_changed(const Color &p_color) {
}
void EditorPropertyColor::_popup_closed() {
- get_edited_object()->set(get_edited_property(), last_color);
+ get_edited_object()->set(get_edited_property(), was_checked ? Variant(last_color) : Variant());
if (!picker->get_pick_color().is_equal_approx(last_color)) {
emit_changed(get_edited_property(), picker->get_pick_color(), "", false);
}
@@ -2653,6 +2653,7 @@ void EditorPropertyColor::_popup_closed() {
void EditorPropertyColor::_picker_opening() {
last_color = picker->get_pick_color();
+ was_checked = !is_checkable() || is_checked();
}
void EditorPropertyColor::_notification(int p_what) {