From 0ac5be1e673836390c142ce16bccf49d04d337a9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 23 May 2021 13:54:45 +0200 Subject: [PATCH] Reset Shader Editor scroll when changing shader --- editor/plugins/shader_editor_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index ce12f19c590..a210a461271 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -63,6 +63,8 @@ void ShaderTextEditor::set_edited_shader(const Ref &p_shader) { get_text_editor()->set_text(p_shader->get_code()); get_text_editor()->clear_undo_history(); + get_text_editor()->call_deferred("set_h_scroll", 0); + get_text_editor()->call_deferred("set_v_scroll", 0); _validate_script(); _line_col_changed();