From 287798fadfbfd7523d5bc39e7f101a53c4ba791c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 17 Jun 2024 15:35:59 +0200 Subject: [PATCH] Changed StampBrush to do rectangle-erase on right-click Feature requested by elvisish, but can't be merged like this. Instead, the mouse interaction in general would need to be made more configurable. This change currently leaves no way to capture a stamp from the map. --- src/tiled/stampbrush.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/tiled/stampbrush.cpp b/src/tiled/stampbrush.cpp index 8b6f8add12..142b057d13 100644 --- a/src/tiled/stampbrush.cpp +++ b/src/tiled/stampbrush.cpp @@ -317,7 +317,7 @@ void StampBrush::beginCapture() mBrushState = BrushState::Capture; mCaptureStampHelper.beginCapture(tilePosition()); - setStamp(TileStamp()); + updatePreview(); } void StampBrush::endCapture() @@ -327,12 +327,12 @@ void StampBrush::endCapture() mBrushState = BrushState::Free; - const bool cut = mModifiers & Qt::ShiftModifier; - TileStamp stamp = mCaptureStampHelper.endCapture(*mapDocument(), tilePosition(), cut); - if (!stamp.isEmpty()) - emit stampChanged(stamp); - else - updatePreview(); + const bool allLayers = false; + const bool mergeable = false; + mapDocument()->eraseTileLayers(mCaptureStampHelper.capturedArea(tilePosition()), + allLayers, mergeable); + + updatePreview(); } /**