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

Use Vector* component-wise min/max/clamp functions where applicable

This commit is contained in:
A Thousand Ships
2024-03-03 12:49:08 +01:00
parent fe01776f05
commit 79ba22a73f
53 changed files with 95 additions and 176 deletions

View File

@@ -130,7 +130,7 @@ Ref<Texture2D> EditorTexturePreviewPlugin::generate(const Ref<Resource> &p_from,
if (new_size.y > p_size.y) {
new_size = Vector2(new_size.x * p_size.y / new_size.y, p_size.y);
}
Vector2i new_size_i(MAX(1, (int)new_size.x), MAX(1, (int)new_size.y));
Vector2i new_size_i = Vector2i(new_size).max(Vector2i(1, 1));
img->resize(new_size_i.x, new_size_i.y, Image::INTERPOLATE_CUBIC);
post_process_preview(img);