https://bugs.kde.org/show_bug.cgi?id=455919

Deif Lou <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Deif Lou <[email protected]> ---
Hi. Yes, this case is a bit tricky. Even today I have a hard time reasoning
about what should happen and honestly I don't know if that option would be that
useful.

I'll try to explain what I did and see if we should change how it behaves or if
we can make it clearer.

* In the case where the surrounding regions are not included, all the regions
inside the enclosing area that are surrounded by the chosen color and that do
not touch the contour of the enclosing area, are selected.
* Then I thought that maybe allowing to keep also the color that surrounds
would be useful. For example, if you have some regions delimited by a colored
line, like they do in anime, say highlights "blobs" closed by a colored line,
and you want to fill both the interior of the "blob" and the contour as well.
(Most of the time this could be achieved with other modes, that's why I doubt
now this option is that useful. I would not implement it if I were to code this
now. Only if it was requested).
* The algorithm is straightforward:
    * First we select all the regions, from the contour of the enclosing area,
no matter the color, until the surrounding color is reached.
    * So what remains not selected are regions of the surrounding color and
whatever they have inside if they form closed loops. So we invert the selection
to have those selected.
    * Then, if we should not keep the surrounding regions, we just remove those
from the selection.
    * Finally we remove any remaining regions that touches the enclosing area
contour, so that what is selected is entirely inside.
* So, in the case of the strawberries, when "include surrounding regions" is
not selected:
    * Everything from the contour is selected until transparent is reached.
This selects the portions of the top-right strawberry that touch the contour.
    * That selection is inverted, so we have now all the transparent regions
plus the bottom-left strawberry selected.
    * Then we remove the transparent regions, and we are left only with the
pink regions of the bottom-left strawberry.
* When "include surrounding regions" is selected it is more tricky:
    * Everything from the contour is selected until transparent is reached.
This selects the portions of the top-right strawberry that touch the contour.
    * That selection is inverted, so we have now all the transparent regions
plus the bottom-left strawberry selected.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to