summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-04-20 23:56:23 +0200
committerGitHub <noreply@github.com>2020-04-20 23:56:23 +0200
commit114ffb19e658d8617116f52b1a8d9c07fd0c5aca (patch)
tree38105855849f8c4280d6522a5903ac1fef8dfe1f
parent52b27da7a6a0667a0191377f80a9968d65f690c4 (diff)
parentd45e8734d18dd17bd5726dbb1db8fde9be1022ea (diff)
Merge pull request #37982 from DrMoriarty/fix_square_resize
Fix square image resize
-rw-r--r--core/image.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 2097f27b01..58351ae2e5 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -879,6 +879,9 @@ void Image::resize_to_po2(bool p_square) {
int w = next_power_of_2(width);
int h = next_power_of_2(height);
+ if (p_square) {
+ w = h = MAX(w, h);
+ }
if (w == width && h == height) {