Bug 457820 - "trim to selection" not working with contiguous selection tool, before or after inverting
Summary: "trim to selection" not working with contiguous selection tool, before or aft...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Tool/Assistants (other bugs)
Version First Reported In: 5.0.6
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2022-08-13 01:22 UTC by Erik Knepfler
Modified: 2023-06-23 12:00 UTC (History)
0 users

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


Attachments
example of image that will not trim (8.01 KB, image/png)
2022-08-13 01:22 UTC, Erik Knepfler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Knepfler 2022-08-13 01:22:34 UTC
Created attachment 151296 [details]
example of image that will not trim

STEPS TO REPRODUCE
1.   open png with circle image inside empty/transparent bg canvas
2.   use contiguous selection tool to select empty area around circle.  optionally invert selection, makes no difference
3.   Image > Trim to Selection

OBSERVED RESULT
nothing

EXPECTED RESULT
image should trim

SOFTWARE/OS VERSIONS
Windows:  11

ADDITIONAL INFORMATION
Comment 1 Ralek Kolemios 2022-08-16 11:33:31 UTC
Can confirm this happens on nightly appimage builds.

Further info:
Using the box select tool set to 'intersect' and covering the entirety of the selection fixes this state and allows the original shape to be trimmed to.
Comment 2 Dmitry Kazakov 2023-06-23 12:00:09 UTC
Git commit d361e80ffa4676619a242ac3b53b27bd1ec89761 by Dmitry Kazakov.
Committed on 23/06/2023 at 11:58.
Pushed by dkazakov into branch 'master'.

Fix Invert Selection to behave in a bit more sane way

If possible, we shouldn't change the default pixel of the selection,
since it "breaks" selectedExactRect() easily.

M  +27   -1    libs/image/kis_selection_filters.cpp

https://invent.kde.org/graphics/krita/-/commit/d361e80ffa4676619a242ac3b53b27bd1ec89761