Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Stamp Brush right-click cut instead of copying when Shift is held #3961

Closed
kdx2a opened this issue Jun 6, 2024 · 3 comments
Closed
Assignees
Labels
feature It's a feature, not a bug.

Comments

@kdx2a
Copy link
Contributor

kdx2a commented Jun 6, 2024

Is your feature request related to a problem? Please describe.
Moving a group of tiles on a tile layer is too convoluted for such a common operation. Unless I miss something, here's the fastest way to do so (with default keybindings):

  • [press R] switch to Rectangular Select
  • [left click] select area
  • [C-x] cut selection
  • [b] switch to Stamp Brush
  • [left click] paste area

Describe the solution you'd like
Allow to cut a rectangular area in Stamp Brush mode by holding Shift and right-clicking (in addition to the current copying behavior).

Describe alternatives you've considered

  • Add a binding to quickly delete the last area copied with the Stamp Brush.
  • Allow moving a selection directly (ie. by holding right click).
@kdx2a kdx2a added the feature It's a feature, not a bug. label Jun 6, 2024
@eishiya
Copy link
Contributor

eishiya commented Jun 6, 2024

Displacing tiles within a layer is a common operation for some users, but is never needed for others, so overall, it's a rarely-needed feature, which is why it's not gotten much attention.

I think your proposed expansion of the current copying behaviour sounds great! Way more elegant than the more complex behaviour I was thinking of. Shift+right-click seems to be free, it currently causes the Brush Stamp to just not do anything.

Big fat +1 to making Stamp Brush right-click cut instead of copying when Shift is held.
(For clarity, consider changing your issue title to something that describes your proposed change, as your title makes it sound like you want something more complicated.)

I'd previously scripted a Move Tiles Tool that allows moving tiles in multiple drags and via the arrow keys, and while a more complex style of operation like that can be desirable, in practice, a quicker way to just cut and paste would be way faster, even in scenarios where small, precise movements of large groups of tiles are desired.

@kdx2a kdx2a changed the title Fast tile displacement for Tile Layers Make Stamp Brush right-click cut instead of copying when Shift is held Jun 6, 2024
kdx2a added a commit to kdx2a/tiled that referenced this issue Jun 7, 2024
Implementing this required a refactor of the state system in
StampBrush.  Behavior and State were previously handled in the
same property, which resulted both in wrong behavior when using
capture and pressing the behavior keys (replicate by holding
right click, start holding shift, release right click, the behavior
wasn't set to line as it should have). This commit refactors this
system by splitting State and Behavior in two enums and two
properties, resulting in making the implemented feature possible,
fixing behavior bugs, and future-proofing this system for
expansion.

Implements mapeditor#3961
@kdx2a
Copy link
Contributor Author

kdx2a commented Jun 7, 2024

Thank you for your feedback @eishiya! I had time off today, so I looked into the codebase to see how possible it would be and I ended up implementing the feature myself. It wasn't as straightforward as I would have expected, but it works very well now and is very convenient in terms of workflow.

bjorn added a commit that referenced this issue Jun 14, 2024
Implementing this required a refactor of the state system in
StampBrush.  Behavior and State were previously handled in the
same property, which resulted both in wrong behavior when using
capture and pressing the behavior keys (replicate by holding
right click, start holding shift, release right click, the behavior
wasn't set to line as it should have). This commit refactors this
system by splitting State and Behavior in two enums and two
properties, resulting in making the implemented feature possible,
fixing behavior bugs, and future-proofing this system for
expansion.

Implements #3961

Co-authored-by: Thorbjørn Lindeijer <[email protected]>
@bjorn
Copy link
Member

bjorn commented Jun 14, 2024

Implemented by #3963.

@bjorn bjorn closed this as completed Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

3 participants