فهرست منبع

Fix size error in `BitMap.opaque_to_polygons`

Previous estimate of upper limit on size was incorrect

(cherry picked from commit 48347499c23e69b200a597473447f80050d77287)
Ninni Pipping 2 سال پیش
والد
کامیت
a9c451af33
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      scene/resources/bit_map.cpp

+ 1 - 1
scene/resources/bit_map.cpp

@@ -318,7 +318,7 @@ Vector<Vector2> BitMap::_march_square(const Rect2i &rect, const Point2i &start)
 		prevx = stepx;
 		prevy = stepy;
 
-		ERR_FAIL_COND_V((int)count > width * height, _points);
+		ERR_FAIL_COND_V((int)count > 2 * (width * height + 1), _points);
 	} while (curx != startx || cury != starty);
 	return _points;
 }