mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Use fill() to fill an entire image instead of setting pixels individually.
This commit is contained in:
parent
c09c4e0154
commit
c9f5d88f3a
6 changed files with 9 additions and 43 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue