1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Use fill() to fill an entire image instead of setting pixels individually.

This commit is contained in:
Anilforextra
2022-01-08 17:43:15 +05:45
parent c09c4e0154
commit c9f5d88f3a
6 changed files with 9 additions and 43 deletions

View File

@@ -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;