From 7eafae8cf7123fe6ee759bdf76a83d56eb11f931 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 22 Nov 2024 23:13:26 -0500 Subject: [PATCH] Fix map grid not clipping in layout-only mode --- src/ui/graphicsview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/graphicsview.cpp b/src/ui/graphicsview.cpp index a9761139..73827211 100644 --- a/src/ui/graphicsview.cpp +++ b/src/ui/graphicsview.cpp @@ -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); }