Summary: | [selection] Krita can't paint (empty selection, feedback issue) | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | David REVOY <info> |
Component: | Tools/Selection | Assignee: | wolthera <griffinvalley> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | ahab.greybeard, griffinvalley |
Priority: | NOR | ||
Version: | 4.2.9 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/kde/krita/commit/692225a9c4006460802d414a357c27922341d79e | Version Fixed In: | |
Attachments: |
Marching ants selection
Global Selection Mask selection |
Description
David REVOY
2020-04-20 13:01:02 UTC
Created attachment 127733 [details]
Marching ants selection
I can confirm this for the 4.2.9 appimage and a recent 5.0.0 prealpha appimage.
It also happens with a single layer image.
If you make a selection on the canvas and then invert it, the marching ants are shown around the canvas border.
There seems to be a problem with selection boundaries that are on the edge of the canvas:
If you make an on canvas selection and invert it, then use the Move tool, the resulting marching ants display is as expected but then it does not correspond to the global selection mask.
The attached files Ants-A.png and GSM-A.png show an example of this.
Setting to Confirmed
Created attachment 127734 [details]
Global Selection Mask selection
This bug seems to be at core here: template <class StorageStrategy> QVector<QPolygon> KisOutlineGenerator::outlineImpl(typename StorageStrategy::StorageType buffer, qint32 xOffset, qint32 yOffset, qint32 width, qint32 height) It generates no paths under these conditions. further discussion is here: https://invent.kde.org/kde/krita/-/merge_requests/309 copy-pasting the gist of an irc discussion on a technical solution here: three ways to solve that: very hackish, a bit hackish and normal one first one is just to skip adding selection in KisResourcesSnapshot if it is empty. But GUI will be still inconsistent and tools that don't use resources snapshot will still be locked second one: add a custom code to KisSelectionDecoration::selectionChanged() that checks if the selection is empty and adds **a separate undo history step** that deselects the selection, when it is empty, that would break a few coding standards, but would somehow work and the last one: extract the code from KisSelectionToolHelper::selectPixelSelection() that deselects the selection into something reusable and add that to all the selection modification actions the list of actions is not very long, btw - so, I would like to do the last one, but how should I do that with selection-filters? Because the initial report was about the invert filter. And I think it might be quite possible to do with the other selection filters given a little creativity. KisSelectionToolHelper::selectPixelSelection, KisSelectionToolHelper::addSelectionShapes, KisFilterSelectionOperation::runFilter there is a base class, KisFilterSelectionOperation is the base class for all of them. Just add a CompositeCommand to it, like it happens in KisSelectionToolHelper::selectPixelSelection so, ideally, it would be nice to extend the deselection code from KisSelectionToolHelper::selectPixelSelection() to work with local selections as well ah, it is much easier, sorry. You should just use KisDeselectActiveSelectionCommand instead of KisDeselectGlobalSelectionCommand. and this command will choose the proper algorithm automagically -------- (needless to say, we're going with the latter) Git commit 607122920de6885a543421ad7a334e70f24aca10 by Wolthera van Hövell tot Westerflier. Committed on 23/04/2020 at 13:58. Pushed by woltherav into branch 'master'. Ensure that selection masks get unactivated if the selection was emptied. This can happen with selectall and then invert, or selecting an area and then deselecting it fully, which ended up with an empty but active selection, and thus an inability to paint on the drawing. Global selection mask will be removed, local selection masks disabled, and in either case the artist can go back to painting. M +11 -1 libs/ui/operations/kis_filter_selection_operation.cpp M +8 -2 libs/ui/tool/kis_selection_tool_helper.cpp https://invent.kde.org/kde/krita/commit/607122920de6885a543421ad7a334e70f24aca10 Git commit 692225a9c4006460802d414a357c27922341d79e by Agata Cacko, on behalf of Wolthera van Hövell tot Westerflier. Committed on 02/05/2020 at 13:15. Pushed by tymond into branch 'krita/4.3'. Ensure that selection masks get unactivated if the selection was emptied. This can happen with selectall and then invert, or selecting an area and then deselecting it fully, which ended up with an empty but active selection, and thus an inability to paint on the drawing. Global selection mask will be removed, local selection masks disabled, and in either case the artist can go back to painting. M +11 -1 libs/ui/operations/kis_filter_selection_operation.cpp M +8 -2 libs/ui/tool/kis_selection_tool_helper.cpp https://invent.kde.org/kde/krita/commit/692225a9c4006460802d414a357c27922341d79e |