Skip to content

Commit 573bf3e

Browse files
committed
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.
1 parent 2517c68 commit 573bf3e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tiled/stampbrush.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void StampBrush::beginCapture()
317317
mBrushState = BrushState::Capture;
318318
mCaptureStampHelper.beginCapture(tilePosition());
319319

320-
setStamp(TileStamp());
320+
updatePreview();
321321
}
322322

323323
void StampBrush::endCapture()
@@ -327,12 +327,12 @@ void StampBrush::endCapture()
327327

328328
mBrushState = BrushState::Free;
329329

330-
const bool cut = mModifiers & Qt::ShiftModifier;
331-
TileStamp stamp = mCaptureStampHelper.endCapture(*mapDocument(), tilePosition(), cut);
332-
if (!stamp.isEmpty())
333-
emit stampChanged(stamp);
334-
else
335-
updatePreview();
330+
const bool allLayers = false;
331+
const bool mergeable = false;
332+
mapDocument()->eraseTileLayers(mCaptureStampHelper.capturedArea(tilePosition()),
333+
allLayers, mergeable);
334+
335+
updatePreview();
336336
}
337337

338338
/**

0 commit comments

Comments
 (0)