Use parent extent for KisFilterMask
The same behavior (use parent's extends/bounds) is used by transparency masks.
NOTE: I'm opening it as a draft, because this breaks KisFilterMaskTest::testProjectionSelected()
. However, I'm confused why we're even enforcing this behavior. Perhaps we can discuss here, if that's convenient.
The problem I'm trying to solve is that when I kept using fast color overlay ("layer sketch to blue"), I noticed a particular and not too nice behavior -- if I moved my layer with the filter, the bounding box would match the whole canvas, even if my layer was smaller. For example:
But I was expecting it to show a small bounding box instead:
I tried two solutions:
- Not initializing the selection for the mask - but this causes problems:
- saving would crash as it expects the selection to exist
- loading would replace the empty (null shared pointer) with a transparent selection
- Using the same approach as KisTransparencyMask (what is proposed in this patch)
- this seems to work well but breaks the test I mentioned.