Browse Source

Merge pull request #37982 from DrMoriarty/fix_square_resize

Fix square image resize
Rémi Verschelde 5 năm trước cách đây
mục cha
commit
114ffb19e6
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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) {