2
0
Эх сурвалжийг харах

Change to shrink_x2 function preventing it set a 0 width/height

Gabriel 8 жил өмнө
parent
commit
40dcf4a2e7
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      core/image.cpp

+ 2 - 2
core/image.cpp

@@ -1013,8 +1013,8 @@ void Image::shrink_x2() {
 			copymem(w.ptr(), &r[ofs], new_size);
 			copymem(w.ptr(), &r[ofs], new_size);
 		}
 		}
 
 
-		width /= 2;
-		height /= 2;
+		width = MAX(width / 2, 1);
+		height = MAX(height / 2, 1);
 		data = new_img;
 		data = new_img;
 
 
 	} else {
 	} else {