Avoid overflow when calculating visible_cells
This commit is contained in:
parent
f10f76d95d
commit
9e28df22a0
|
@ -211,7 +211,7 @@ struct SpatialIndexer2D {
|
||||||
List<VisibilityNotifier2D *> added;
|
List<VisibilityNotifier2D *> added;
|
||||||
List<VisibilityNotifier2D *> removed;
|
List<VisibilityNotifier2D *> removed;
|
||||||
|
|
||||||
int visible_cells = (end.x - begin.x) * (end.y - begin.y);
|
uint64_t visible_cells = (uint64_t)(end.x - begin.x) * (uint64_t)(end.y - begin.y);
|
||||||
|
|
||||||
if (visible_cells > 10000) {
|
if (visible_cells > 10000) {
|
||||||
//well you zoomed out a lot, it's your problem. To avoid freezing in the for loops below, we'll manually check cell by cell
|
//well you zoomed out a lot, it's your problem. To avoid freezing in the for loops below, we'll manually check cell by cell
|
||||||
|
|
Loading…
Reference in New Issue