Browse Source

Fix square image resize

Fixes #37980
Vasiliy Makarov 5 years ago
parent
commit
d45e8734d1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      core/image.cpp

+ 3 - 0
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) {