Also added undo redo support fro the gradient editor's interpolation type dropdown.

This commit is contained in:
Relintai 2022-03-08 12:12:14 +01:00
parent b17b7bb583
commit 48f5fbfcbb

View File

@ -267,7 +267,15 @@ func update_preview() -> void:
call_deferred("generate_preview_image")
func _on_Interpolation_item_selected(ID) -> void:
value.interpolation_type = ID
ignore_changes(true)
_undo_redo.create_action("MMGD: gradient interpolation_type changed")
_undo_redo.add_do_method(value, "set_interpolation_type", ID)
_undo_redo.add_undo_method(value, "set_interpolation_type", value.interpolation_type)
_undo_redo.commit_action()
ignore_changes(false)
update_preview()
func on_resized() -> void: