Open kdx2a opened 5 months ago
I tested it, seems like a nice improvement and a behavior that one could get used to.
I don't have any comparison with other painting software though. I tried to compare with GIMP and Krita, but neither appears to have such behavior (or I just couldn't find it):
@eishiya Since in #3642 you wrote "If the user releases Shift before the mouse button, then the line should not be drawn", and this PR behaves differently, it would be great if you could check the behavior.
One thing that's a little surprising to me is the behavior when doing the following:
This cancels the line drawing and now you're kind of stuck in a useless mode until you also release the mouse button. I had expected the behavior to be the same as when pressing/releasing shift while painting: to draw the line and enter free painting mode. Does that sound reasonable?
I do not like how if I click, then hold shift, and then release shift without releasing the click, the line is drawn anyway. If I release shift, it's because I've changed my mind about drawing a line from that particular location, the last thing I want is for that line to be committed. It's also unnatural for a preview to be committed just because the state of a modifier changed, IMO. I expect to modify the map with a click or a release, never with a modifier change. I see that right-clicking cancels the line, but that's somewhat unexpected since usually Stamp Brush right-click samples tiles.
I think that after Shift is released, the tool should NOT draw the line, exit line mode, and require letting go of LMB to start painting again, similar to Tiled's current behaviour. #3642 just asks for the ability to start line mode if LMB is already held xP (Well, I did ask for freehand mode from that location in the issue, but in retrospect that would still lead to unwanted painting, so I hereby withdraw that request xP)
However, I do see the benefits of committing on releasing shift, particularly when blocking in maps (i.e. when precision is less important than speed). Perhaps it could be provided as an option on the Stamp Brush tool, called something like "quick line mode"? When this mode is enabled, releasing shift while LMB is held should commit the line, and the brush should switch to freehand painting mode as Bjorn described, regardless of whether the user clicked before or after pressing Shift.
I don't have any comparison with other painting software though. I tried to compare with GIMP and Krita, but neither appears to have such behavior (or I just couldn't find it):
IIRC Krita had that behavior in the past but changed it recently (can't remember when though). Or maybe I halucinated it? if that's the case my apologies.
I had expected the behavior to be the same as when pressing/releasing shift while painting: to draw the line and enter free painting mode. Does that sound reasonable?
Perhaps it could be provided as an option on the Stamp Brush tool, called something like "quick line mode"? When this mode is enabled, releasing shift while LMB is held should commit the line, and the brush should switch to freehand painting mode as Bjorn described, regardless of whether the user clicked before or after pressing Shift.
I made that choice to stay consistent with the current Tiled behavior while allowing this new workflow. It complicated the code a bit doing it this way, having it consistent with itself would reduce duplication. So I agree with eishiya's proposal to make it optional. Where should I look in the codebase to see how to add such a setting?
So I agree with eishiya's proposal to make it optional. Where should I look in the codebase to see how to add such a setting?
I'm not really comfortable with adding an option for this. It seems the easy way out as soon as there isn't a consensus about the desired behavior, but it puts a burden on both the maintainers and the users forever.
@kdx2a Were you really looking for the implemented behavior or was this something that came out of trying to address #3642?
I think there's also an alternative that still allows mixing many organic and straight lines, which might be less controversial:
With the above, you can hold Shift, draw straight lines while LMB is released and organic pieces while LMB is pressed. Releasing Shift will always cancel any current line preview.
I think the main tricky part in the above is what to do with the initial "hold Shift and then LMB + drag + release". Currently, this is a quick way to draw a single line segment and it should probably stay that way. That means that organic segments can only be drawn by drag after drawing at least one line.
I'm not really comfortable with adding an option for this. It seems the easy way out as soon as there isn't a consensus about the desired behavior, but it puts a burden on both the maintainers and the users forever.
I see, I respect this design philosophy.
@kdx2a Were you really looking for the implemented behavior or was this something that came out of trying to address #3642?
I was looking for the implemented behavior while keeping in mind #3642. But I warrant it might be better to see this pull request as unrelated, since in the end it doesn't seem to fix #3642 and I think a new behavior in this vein is more beneficial to Tiled as a whole.
I think there's also an alternative that still allows mixing many organic and straight lines, which might be less controversial:
- When releasing the mouse while painting and holding Shift, it would set the start position of the next line.
- When pressing LMB, it will draw the previewed line, and when you drag from there, it would be freehand painting.
I like this. Here is how I think approaching implementing this behavior:
Allows starting to draw, holding shift to preview a straight line, and releasing to draw it. This is enabled by the addition of a
PaintStartSet
state. Pressing right click duringStartSet
orPaintStartSet
cancels the operation and returns to Free. This is inspired by the behavior of the pencil in some image editing software. Thinking about the issue #3642 while working on this, I made sure than clicking, holding shift, then releasing shift, switches fromPaintStartSet
toStartSet
to avoid user confusion.I invite the reader to test this feature. I think it is good, since it's non intrusive and eases the better flow when mixing many organic and straight lines. But I understand how this might be controversial.
closes #3642