diff options
author | George Marques <george@gmarqu.es> | 2017-06-19 10:54:05 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 10:54:05 -0300 |
commit | 9583ecf7e8042da67444802d94c57c797eb7e0a2 (patch) | |
tree | ff8344e875b24d73c64a022e58c6d25950cf320d | |
parent | 0288be1e7698c984b159bbb7816ddc7aca43b2f1 (diff) | |
parent | 6592df74d8984514d02a25b2ac4fb333b2bbc003 (diff) |
Merge pull request #9239 from lethiandev/master
Fix image lock on preview image generating
-rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index 7f8b98e1d3..11d804422a 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -427,13 +427,14 @@ Ref<Texture> 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++) { |