Bug 408369 - Tool Glitch with selection
Summary: Tool Glitch with selection
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: 5.2.6
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-06 04:15 UTC by Vanessa
Modified: 2024-11-14 13:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
My best result for evidence, like I said I'm not good at this (177.79 KB, image/png)
2019-06-06 04:15 UTC, Vanessa
Details
attachment-18621-0.html (4.85 KB, text/html)
2019-06-06 08:57 UTC, Vanessa
Details
Selection with missing outline and 0 px wide sections (15.56 KB, image/png)
2024-11-14 09:28 UTC, Vitamorus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vanessa 2019-06-06 04:15:15 UTC
Created attachment 120614 [details]
My best result for evidence, like I said I'm not good at this

SUMMARY
Hi this is my first ever bug report for Krita so I 
hope I can help resolve this issue.
Anyway, I just recently updated to Krita 4.2.0
and I was noticing an error between the selection tool,
when it come to the older version, I was able to click the function I want 
with out worry of a mix up, like if I wanted to subtract from a specific spot, I could with out worrying about it being colored in. But now it is acting like the rest of adding, and the only thing currently working for selection is adding and replace.I was also noticing with the Copy Layer button as well wasn't working with Vectors like it used to as well, so that's another bug there.   
STEPS TO REPRODUCE
1. Click on tool
2. Select subtract
3. Still Adds

OBSERVED RESULT
Looking like it adds

EXPECTED RESULT
I can cage the area without worrying about the Eraser taking out my picture.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Ahab Greybeard 2019-06-06 08:00:38 UTC
I've set this to Confirmed because there is at least one problem with selections.

I've tested this with the recent 4.2.1 Linux appimage release:

If you start a selection sequence with the Selection tool set to Subtract, it will effectively subtract the selected shape from the entire image selection. After that, it does look as if the Subtract option adds to the shape but it is in fact subtracting from the selected area which is the region outside the first shape. (Does that explain what is happening?)

If you then use Intersect, there is a strange effect where there are two nested dotted regions.

If you use the Replace or Add option as your first selection in a sequence, then the process has a 'look' that is more normal. However, the Intersect action then has a malformed outline.

I think that it shouldn't be possible to use a Subtract as the first selection operation on an image that has no active selection. This is a matter for higher level discussion somewhere.

As for copying vector layers, there is an existing bug about Duplicating vector layers: https://bugs.kde.org/show_bug.cgi?id=408028  but you'd need to provide more information about why you feel it isn't working like it used to. Also, that vector layer problem should be as a separate bug report if you want to go into more detail.
Comment 2 Vanessa 2019-06-06 08:57:27 UTC
Created attachment 120619 [details]
attachment-18621-0.html

Dear Ahab GreyBeard

Thank you for your very prompt response to my report
on the issue, and also your candid advice for the solution.

I do apologize for my information being vague, I am sadly inexperienced
At this sort of thing and I hopefully will get better at it soon,
And I also do apologize for the Double bug report, I thought the problem
was
So I add it to the first, and again I apologize for my lack of experience

I was about ready to say the recent update fixed the problem and tell you
it is not an issue
anymore but I just ran into the problem again, But your advice saved me
some headache
And it's working like it should.

I honestly didn't know that, I was able to do it before...To be honest with
the recent updates I
am trying my best to relearn some of the mechanics...^^; and learn to
properly use
this amazing art program, I honestly gotten in full swing with Krita around
October of last year,
 I am sorry for my rambling.

And I actually don't need to go over the vector layer copy bug, I am
running the program now and I reproduced
the problem I had problems with earlier, and the new update took care of
it, now I can duplicate
the Vectors easily now, without worrying about it being destroyed.
Which is what I was facing with before the update, and I don't have to
chase it around on the original, when it should have been on the layer
copied...

I hope that explains the problems and Thank you
For taking care of the problem it has been very helpful.

And you just save me from alot of hard work in the long run.

Take care and Have a nice day.

Also Thank you for your time.

On Thu, Jun 6, 2019 at 1:00 AM Ahab Greybeard <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=408369
>
> Ahab Greybeard <ahab.greybeard@hotmail.co.uk> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|REPORTED                    |CONFIRMED
>      Ever confirmed|0                           |1
>                  CC|
> |ahab.greybeard@hotmail.co.u
>                    |                            |k
>
> --- Comment #1 from Ahab Greybeard <ahab.greybeard@hotmail.co.uk> ---
> I've set this to Confirmed because there is at least one problem with
> selections.
>
> I've tested this with the recent 4.2.1 Linux appimage release:
>
> If you start a selection sequence with the Selection tool set to Subtract,
> it
> will effectively subtract the selected shape from the entire image
> selection.
> After that, it does look as if the Subtract option adds to the shape but
> it is
> in fact subtracting from the selected area which is the region outside the
> first shape. (Does that explain what is happening?)
>
> If you then use Intersect, there is a strange effect where there are two
> nested
> dotted regions.
>
> If you use the Replace or Add option as your first selection in a sequence,
> then the process has a 'look' that is more normal. However, the Intersect
> action then has a malformed outline.
>
> I think that it shouldn't be possible to use a Subtract as the first
> selection
> operation on an image that has no active selection. This is a matter for
> higher
> level discussion somewhere.
>
> As for copying vector layers, there is an existing bug about Duplicating
> vector
> layers: https://bugs.kde.org/show_bug.cgi?id=408028  but you'd need to
> provide
> more information about why you feel it isn't working like it used to. Also,
> that vector layer problem should be as a separate bug report if you want
> to go
> into more detail.
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Ahab Greybeard 2019-06-06 09:32:14 UTC
No problem Vanessa, there is a bug with selections.

If you have any concerns about krita behaviour in the future, the krita forums are a good place to ask for advice: https://forum.kde.org/viewforum.php?f=136
Especially the General Help forum: https://forum.kde.org/viewforum.php?f=139

If you're not sure about anything, it's a helpful and friendly place to go.
Comment 4 Vitamorus 2024-11-14 09:28:28 UTC
Created attachment 175806 [details]
Selection with missing outline and 0 px wide sections

Re-confirming this for 5.2.6.

So, to clarify:
If you open/create a new document, click on any of the selection tools, set it to 'Subtract' and make a new selection, Krita will automatically generate a selection of the entire canvas and subtract from it. If you're zoomed in and unaware of this feature, it looks like subtract is adding a selection. This seems to be intentional and not a bug. 

I don't know if it's preferable from a UX perspective though. I think some would argue that that all selections should be explicit and making a subtraction selection from nothing should just do nothing.

However, as Ahab discovered, the 'Intersect' mode can sometimes produce some visual glitches. I've attached an image showing a possible result; missing selection outlines and sections that are 0 px wide. Note that this is only a visual bug with the outline, and that drawing over the selection shows what the real selection is. If I add/subtract a couple of additional selections elsewhere on the canvas the outline will "refresh" and correct itself.
Comment 5 Dmitry Kazakov 2024-11-14 13:53:13 UTC
Git commit 9809f623ac63e0a0ef51c224f0e79a9d9ebca61d by Dmitry Kazakov.
Committed on 14/11/2024 at 13:52.
Pushed by dkazakov into branch 'krita/5.2'.

Fix unclosed paths when intersecting two rectangular selections

It seems like Qt has a bug and leaves some edges open when intersecting
rectangles. So we should manually close all the subpath when something like
that happens.

M  +2    -2    libs/image/kis_pixel_selection.cpp
M  +17   -0    libs/image/krita_utils.cpp
M  +14   -0    libs/image/krita_utils.h
M  +1    -1    libs/ui/tool/kis_selection_tool_helper.cpp

https://invent.kde.org/graphics/krita/-/commit/9809f623ac63e0a0ef51c224f0e79a9d9ebca61d
Comment 6 Dmitry Kazakov 2024-11-14 13:53:20 UTC
Git commit 2485ada3de2267baa19dfd8562ed916126a7c8d0 by Dmitry Kazakov.
Committed on 14/11/2024 at 13:07.
Pushed by dkazakov into branch 'krita/5.2'.

Make vector and raster selections to behave in the same way when creating tiny selections

1) Rectangle and Ellipse selection tools should do nothing when crating 0px-wide
    selections. They just do nothing, not "deselect" action. For deselect the user should
    actually to a click.

2) When creating subtract-mode selection on empty selection, Krita should first select
    the entire image, and then remove the selected portion. This behavior existed in Krita
    since at least 2010. This patch just makes vector mode to behave consistently with
    the pixel mode.

Note: bug 408369 is almost fixed. The only issue left is the intersection mode artifacts.
Related: bug 445935

M  +20   -8    libs/ui/tool/kis_selection_tool_helper.cpp
M  +4    -0    plugins/tools/selectiontools/kis_tool_select_elliptical.cc
M  +3    -3    plugins/tools/selectiontools/kis_tool_select_rectangular.cc

https://invent.kde.org/graphics/krita/-/commit/2485ada3de2267baa19dfd8562ed916126a7c8d0
Comment 7 Dmitry Kazakov 2024-11-14 13:53:57 UTC
Git commit c3279cd2ae469615dcdf0980297e4e1420565ce1 by Dmitry Kazakov.
Committed on 14/11/2024 at 13:53.
Pushed by dkazakov into branch 'master'.

Make vector and raster selections to behave in the same way when creating tiny selections

1) Rectangle and Ellipse selection tools should do nothing when crating 0px-wide
    selections. They just do nothing, not "deselect" action. For deselect the user should
    actually to a click.

2) When creating subtract-mode selection on empty selection, Krita should first select
    the entire image, and then remove the selected portion. This behavior existed in Krita
    since at least 2010. This patch just makes vector mode to behave consistently with
    the pixel mode.

Note: bug 408369 is almost fixed. The only issue left is the intersection mode artifacts.
Related: bug 445935

M  +20   -8    libs/ui/tool/kis_selection_tool_helper.cpp
M  +4    -0    plugins/tools/selectiontools/kis_tool_select_elliptical.cc
M  +3    -3    plugins/tools/selectiontools/kis_tool_select_rectangular.cc

https://invent.kde.org/graphics/krita/-/commit/c3279cd2ae469615dcdf0980297e4e1420565ce1
Comment 8 Dmitry Kazakov 2024-11-14 13:53:59 UTC
Git commit 9a8064bb1103a2cd6f3c2ea4a9cb0255a62d66b2 by Dmitry Kazakov.
Committed on 14/11/2024 at 13:53.
Pushed by dkazakov into branch 'master'.

Fix unclosed paths when intersecting two rectangular selections

It seems like Qt has a bug and leaves some edges open when intersecting
rectangles. So we should manually close all the subpath when something like
that happens.

M  +2    -2    libs/image/kis_pixel_selection.cpp
M  +17   -0    libs/image/krita_utils.cpp
M  +14   -0    libs/image/krita_utils.h
M  +1    -1    libs/ui/tool/kis_selection_tool_helper.cpp

https://invent.kde.org/graphics/krita/-/commit/9a8064bb1103a2cd6f3c2ea4a9cb0255a62d66b2