Patch to fix selection test and mask extent

Cyrille Berger cberger at cberger.net
Fri Apr 9 13:04:56 CEST 2010


On Wednesday 24 March 2010, Dmitry Kazakov wrote:
> Hmm.. I've added these functions just recently:
> http://websvn.kde.org/?view=revision&revision=1099644
> 
> The logic was the following:
> 
> extent() - is the area where the node has an influence on the result image.
> In other words, it is an area, where we should update when the layer
> changes it's visibility.
> 
> KisMask::extent() - works right this way. It tells the area, where
> selection is. And this is right for most of the masks, except of the
> transparency mask. A transparency mask changes the entire image, except of
> the selection. It means that we should update everywhere, except of the
> selection. And if we don't have parent, we can't do anything.

Btw, shouldn't that be:

QRect KisTransparencyMask::extent() const
{
    return parent() ? parent()->extent().intersect(selection().extent()) : 
QRect();
}

QRect KisTransparencyMask::exactBounds() const
{
    return parent() ? parent()-
>exactBounds().intersect(selection().exactBounds()) : QRect();
}

(which would be true for all masks, no ?)

-- 
Cyrille Berger


More information about the kimageshop mailing list