Patch to fix selection test and mask extent

Dmitry Kazakov dimula73 at gmail.com
Fri Apr 9 14:21:47 CEST 2010


On Fri, Apr 9, 2010 at 2:04 PM, Cyrille Berger <cberger at cberger.net> wrote:

> 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 ?)
>

It is true for all the masks, except a transparency mask. The transparency
mask is special, because it influences the entire image. It removes *all*
the image's content and paint's it's selection on the top.

If you change transparency mask extent back, there will be a bug showing
that: the image will be updated wrongly after you switch off/on visibility
of the transparency mask.


-- 
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kimageshop/attachments/20100409/5f307d2a/attachment.htm 


More information about the kimageshop mailing list