Skip to content

Commit

Permalink
Changed StampBrush to do rectangle-erase on right-click
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bjorn committed Jun 17, 2024
1 parent bd891d6 commit 287798f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tiled/stampbrush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void StampBrush::beginCapture()
mBrushState = BrushState::Capture;
mCaptureStampHelper.beginCapture(tilePosition());

setStamp(TileStamp());
updatePreview();
}

void StampBrush::endCapture()
Expand All @@ -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();
}

/**
Expand Down

0 comments on commit 287798f

Please sign in to comment.