From 6592df74d8984514d02a25b2ac4fb333b2bbc003 Mon Sep 17 00:00:00 2001 From: Konrad Nowakowski Date: Sat, 17 Jun 2017 17:11:43 +0100 Subject: [PATCH] Fix image lock on preview image generating --- editor/plugins/editor_preview_plugins.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 7f8b98e1d38..11d804422a0 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -427,13 +427,14 @@ Ref EditorScriptPreviewPlugin::generate(const RES &p_from) { Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"); Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"); + img->lock(); + for (int i = 0; i < thumbnail_size; i++) { for (int j = 0; j < thumbnail_size; j++) { img->put_pixel(i, j, bg_color); } } - img->lock(); bool prev_is_text = false; bool in_keyword = false; for (int i = 0; i < code.length(); i++) {