Skip to content

Commit

Permalink
Fix image lock on preview image generating
Browse files Browse the repository at this point in the history
  • Loading branch information
lethiandev committed Jun 19, 2017
1 parent 0288be1 commit 6592df7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/editor_preview_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 6592df7

Please sign in to comment.