Bug 445935 - Wrong/Zero selection. Less then 1 px
Summary: Wrong/Zero selection. Less then 1 px
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tools/Selection (show other bugs)
Version: 5.2.6
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-22 17:36 UTC by Alexey
Modified: 2024-11-14 13:54 UTC (History)
2 users (show)

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


Attachments
Not create any selections less than 1px (2.69 MB, video/mp4)
2021-11-22 17:36 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2021-11-22 17:36:49 UTC
Created attachment 143845 [details]
Not create any selections less than 1px

If we click without drag on 1px size that make empty invisible selection.


OBSERVED RESULT
See attachment video


EXPECTED RESULT
Not create any selections less than 1px
Comment 1 Ahab Greybeard 2021-11-24 15:27:25 UTC
I can Confirm that this happens for 4.4.8 onwards, using the appimages.

It happens when using a vector selection. The vector tools can be used to set a size, in pixels, of less that 1.
Comment 2 Vitamorus 2024-11-14 10:02:47 UTC
I can reproduce this in 5.2.6.

It seems the original report was about how making a 0x0 px selection while in 'Replace'-mode will effectively act as deselecting. I assume this is intentional behaviour, but I understand if it's annoying on the occasions you misclick and you remove your selection. This is just a matter of hitting Undo (Ctrl + Z) to restore the selection, though. 

As Ahab pointed out, though, vector selection allows you to make valid selections with 0 px in width or height as long as the other length is >0. I think it'd better if, when making a selection, the selection should only be valid (i.e. generate an outline) if both the length and width are greater than 0.
Comment 3 Dmitry Kazakov 2024-11-14 13:53:11 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 408369

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 4 Dmitry Kazakov 2024-11-14 13:54:05 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 408369

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