Skip to content

Commit

Permalink
Fix map grid not clipping in layout-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Nov 23, 2024
1 parent d3a34cf commit 7eafae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/graphicsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ void MapView::drawForeground(QPainter *painter, const QRectF&) {
// Draw map grid
if (editor->mapGrid && editor->mapGrid->isVisible()) {
painter->save();
if (editor->map) {
if (editor->layout) {
// We're clipping here to hide parts of the grid that are outside the map.
const QRectF mapRect(-0.5, -0.5, editor->map->getWidth() * 16 + 1.5, editor->map->getHeight() * 16 + 1.5);
const QRectF mapRect(-0.5, -0.5, editor->layout->getWidth() * 16 + 1.5, editor->layout->getHeight() * 16 + 1.5);
painter->setClipping(true);
painter->setClipRect(mapRect);
}
Expand Down

0 comments on commit 7eafae8

Please sign in to comment.