Skip to content

Commit

Permalink
Modify the scene only when color changed
Browse files Browse the repository at this point in the history
Editor now changes a color in the inspector only when it is different
from the current one.

Solves fake unsaved changes in editor after using the ColorPicker.

Resolves: godotengine#40879
  • Loading branch information
AlphaOneProject committed Aug 3, 2020
1 parent 9adf6d3 commit f362636
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,11 @@ EditorPropertyTransform::EditorPropertyTransform() {
////////////// COLOR PICKER //////////////////////

void EditorPropertyColor::_color_changed(const Color &p_color) {
// Cancel the color change if the current color is identical to the new one.
if (get_edited_object()->get(get_edited_property()) == p_color) {
return;
}

emit_changed(get_edited_property(), p_color, "", true);
}

Expand Down

0 comments on commit f362636

Please sign in to comment.