Skip to content

Commit f0afca3

Browse files
authored
Merge pull request #7264 from osamahammad21/dpl-padding-exceeding-grid
DPL: allow padding to exceed grid indices
2 parents c089775 + 00b3207 commit f0afca3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/dpl/src/infrastructure/Grid.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ void Grid::paintPixel(Node* cell, GridX grid_x, GridY grid_y)
329329
for (GridX x{grid_x}; x < x_end; x++) {
330330
for (GridY y{grid_y}; y < y_end; y++) {
331331
Pixel* pixel = gridPixel(x, y);
332+
if (pixel == nullptr) {
333+
// This can happen if cell padding is larger than the grid.
334+
continue;
335+
}
332336
pixel->cell = cell;
333337
pixel->util = 1.0;
334338
}

0 commit comments

Comments
 (0)