summaryrefslogtreecommitdiff
path: root/editor/plugins/editor_preview_plugins.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-08 23:38:06 +0100
committerGitHub <noreply@github.com>2022-01-08 23:38:06 +0100
commit32abe36cceacf7221fde09f84e0610c7d4741640 (patch)
tree6a48950aef7472d1baf57dc50403b20ef12fc1c3 /editor/plugins/editor_preview_plugins.cpp
parente03714f66c1047024de5adc5b8f42f3edc8abcb9 (diff)
parentc9f5d88f3a152be03450af364075420e10dc1f18 (diff)
Merge pull request #56617 from AnilBK/use_fill
Use fill() to fill an entire image instead of setting pixels individually.
Diffstat (limited to 'editor/plugins/editor_preview_plugins.cpp')
-rw-r--r--editor/plugins/editor_preview_plugins.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 2053194dc1..cef505181a 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -514,11 +514,7 @@ Ref<Texture2D> EditorScriptPreviewPlugin::generate(const RES &p_from, const Size
}
bg_color.a = MAX(bg_color.a, 0.2); // some background
- for (int i = 0; i < thumbnail_size; i++) {
- for (int j = 0; j < thumbnail_size; j++) {
- img->set_pixel(i, j, bg_color);
- }
- }
+ img->fill(bg_color);
const int x0 = thumbnail_size / 8;
const int y0 = thumbnail_size / 8;