diff options
-rw-r--r-- | core/object/undo_redo.cpp | 12 | ||||
-rw-r--r-- | core/object/undo_redo.h | 2 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/texture_region_editor_plugin.cpp | 5 |
4 files changed, 13 insertions, 9 deletions
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp index f7a12a7528..ee8eb97a93 100644 --- a/core/object/undo_redo.cpp +++ b/core/object/undo_redo.cpp @@ -312,18 +312,18 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { switch (op.type) { case Operation::TYPE_METHOD: { + int argc = op.args.size(); Vector<const Variant *> argptrs; - argptrs.resize(op.args.size()); - int argc = 0; + argptrs.resize(argc); - for (int i = 0; i < op.args.size(); i++) { + for (int i = 0; i < argc; i++) { argptrs.write[i] = &op.args[i]; } Callable::CallError ce; obj->callp(op.name, (const Variant **)argptrs.ptr(), argc, ce); if (ce.error != Callable::CallError::CALL_OK) { - ERR_PRINT("Error calling method from signal '" + String(op.name) + "': " + Variant::get_call_error_text(obj, op.name, (const Variant **)argptrs.ptr(), argc, ce)); + ERR_PRINT("Error calling UndoRedo method operation '" + String(op.name) + "': " + Variant::get_call_error_text(obj, op.name, (const Variant **)argptrs.ptr(), argc, ce)); } #ifdef TOOLS_ENABLED Resource *res = Object::cast_to<Resource>(obj); @@ -334,7 +334,7 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) { #endif if (method_callback) { - method_callback(method_callbck_ud, obj, op.name, (const Variant **)argptrs.ptr(), argc); + method_callback(method_callback_ud, obj, op.name, (const Variant **)argptrs.ptr(), argc); } } break; case Operation::TYPE_PROPERTY: { @@ -432,7 +432,7 @@ void UndoRedo::set_commit_notify_callback(CommitNotifyCallback p_callback, void void UndoRedo::set_method_notify_callback(MethodNotifyCallback p_method_callback, void *p_ud) { method_callback = p_method_callback; - method_callbck_ud = p_ud; + method_callback_ud = p_ud; } void UndoRedo::set_property_notify_callback(PropertyNotifyCallback p_property_callback, void *p_ud) { diff --git a/core/object/undo_redo.h b/core/object/undo_redo.h index 8871a549f8..ecd7a21167 100644 --- a/core/object/undo_redo.h +++ b/core/object/undo_redo.h @@ -92,7 +92,7 @@ private: CommitNotifyCallback callback = nullptr; void *callback_ud = nullptr; - void *method_callbck_ud = nullptr; + void *method_callback_ud = nullptr; void *prop_callback_ud = nullptr; MethodNotifyCallback method_callback = nullptr; diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 3138801cdb..10b6129864 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1335,6 +1335,9 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) { void ScriptTextEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_THEME_CHANGED: + if (!editor_enabled) { + break; + } if (is_visible_in_tree()) { _update_warnings(); _update_errors(); diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp index ee31131d86..adb8590246 100644 --- a/editor/plugins/texture_region_editor_plugin.cpp +++ b/editor/plugins/texture_region_editor_plugin.cpp @@ -85,8 +85,10 @@ void TextureRegionEditor::_region_draw() { edit_draw->draw_texture(base_tex, Point2()); RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D()); + const Color color = get_theme_color(SNAME("mono_color"), SNAME("Editor")); + if (snap_mode == SNAP_GRID) { - Color grid_color = Color(1.0, 1.0, 1.0, 0.15); + const Color grid_color = Color(color.r, color.g, color.b, color.a * 0.15); Size2 s = edit_draw->get_size(); int last_cell = 0; @@ -172,7 +174,6 @@ void TextureRegionEditor::_region_draw() { mtx.basis_xform(raw_endpoints[2]), mtx.basis_xform(raw_endpoints[3]) }; - Color color = get_theme_color(SNAME("mono_color"), SNAME("Editor")); for (int i = 0; i < 4; i++) { int prev = (i + 3) % 4; int next = (i + 1) % 4; |