浏览代码

Merge pull request #76544 from AThousandShips/bit_poly_size_3_x

[3.x] Fix size error in `BitMap.opaque_to_polygons`
Rémi Verschelde 2 年之前
父节点
当前提交
281e5703b1
共有 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;
 }