Control modifier in freehand selection tool

Hi, as part of the “enclose and fill” tool I’m making, I’m refactoring some code from the freehand selection tool, so that it can be reused in other places.

Since I’ll have to deal with that code I thought I could also deal with the control modifier issue present in the freehand selection tool. The thing is that there is a conflict using the control modifier since it is used for two purposes: temporarily activating the “replace” selection mode (generic selection tool behavior) and temporarily activating the “straight line / continued” mode (freehand selection specific).

There is at least two bug reports about it:

So the question is. How should this issue be solved? I think the control key should works as in the other tools (activate replace mode), but also think that the “straight line” mode is useful.

One option is to just use another key to activate/deactivate the “straight mode”. What do you think?

2 Likes

Your suggestion seems to me to be the most practical.
So I would use “The one option”.

Michelist

Well, I was hoping for some suggestions. Specially if someone is able to come with a solution that works well with tablet only that would be great.

Sorry, I’m just a leftover PC user from the middle of the last century, I stay away from such modern things like tablets, I need keyboard and monitor otherwise I’m lost, okay in between I’m adapted to use a mouse too. :rofl:

Michelist

In photoshop the shortcut Alt is repeated between straight line mode and subtract mode. So I checked how photoshop solves this issue.
In Photoshop the user has to release the key and then press alt again to access straight line mode while in subtract mode.
here is the step by step -

  1. User is in Addition mode
  2. User presses Alt key before making the selection to activate the subtract mode.
  3. User starts the selection.
  4. Now when user wants a straight line user releases the alt key and then presses it again.

Both in Krita and in photoshop it is not necessary to keep pressing the modifier, once the mode is started it stays that way till the user finishes the selection. So this gives a chance to release the key and use the same key for straight lines. So in Krita to similar solution is

  1. User is in replace mode
  2. User Holds shift key to go into add mode before starting the selection
  3. User draws a selection
  4. While drawing the selection user now releases the shift key and presses ctrl key to change to straight line.

The issue in Krita that is the cause of the bug linked above is it changes the mode even if the user presses ctrl key after starting a selection. This is true only for the Ctrl key and not for the Shift or Alt key. You can check that If you press Alt after starting the selection nothing happens the mode stays the same. Ideally the ctrl key should change mode if it is held before drawing the selection and turn into straight line only when pressed after starting the selection. When the user is in the middle of drawing selection any modifier key should not change the mode of selection. If the mode of selection is not changed with modifier press after drawing the selection we have all the three modifier key free. Like Shift can be utilised for getting straight lines snapped to 15 degree angle which is not present in Krita yet.

So the solution to the bug is to only consider modifier Ctrl (or any other modifier press) for replace mode if it is pressed before actually drawing a selection and not while drawing a selection.

6 Likes

Harmony between all tools is more important than individual use case. This would ensure users know what to expect from the select tools as a whole.

3 Likes

That sounds like a very good solution. I’m glad that current mid-stroke ctrl for straight line wouldn’t change - I’m really used to this shortcut and use it a lot.

1 Like

@raghukamath yes I think your analysis is correct and I will try to make it that way and make all the tools behave similarly like @EyeOdin said. This also will let us mantain the control key for the “straight mode” in the freehand selection tool like @wojtryb said.

Thank you everybody for the comments.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Hi, everyone.

I just merged the patch with the changes suggested by @raghukamath, implementing a clear separation between use of modifiers when the user is selecting and when they are not.

As a bonus I added some new cursors for the “intersect mode” and “symmetric difference mode”. For “intersect mode” I used 2 segments intersecting each other (an X), like in PS; for “symmetric difference mode” I used a triangle, which is commonly used in maths and set theory for that operation.

17 Likes

Just tested and it works amazing. This is so much more intuitive and robust than before. Finally I don’t have to worry the mode will change by accident.

Once again huge thanks for all those small UX changes. These are the things that (positively) affect my workflow more than some of the bigger features :slight_smile:

1 Like

@Deif_Lou thank you very much for fixing this. this works more reliably and predictably. as @wojtryb said it is more intuitive than before.

God bless you @Deif_Lou .
Thank you for this much awaited update.
Finally it happened. :sob: :sob: :sob:
We needed this so much.