From d45e8734d18dd17bd5726dbb1db8fde9be1022ea Mon Sep 17 00:00:00 2001 From: Vasiliy Makarov Date: Sat, 18 Apr 2020 13:29:01 +0300 Subject: [PATCH] Fix square image resize Fixes #37980 --- core/image.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/image.cpp b/core/image.cpp index 2097f27b01a..58351ae2e59 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) {