소스 검색

Modify the scene only when color changed

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: #40879
(cherry picked from commit f3626364fc97c6b0d4692d5e8d5c5f3aeddc3f17)
Antoine Félix 5 년 전
부모
커밋
3211a51be8
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      editor/editor_properties.cpp

+ 4 - 0
editor/editor_properties.cpp

@@ -1885,6 +1885,10 @@ 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);
 }