exactBounds

Sol Heredia sh at asiayargentina.com
Tue Jul 17 22:56:03 CEST 2007


Please, remove me from your list.
Thank you,


Sol

-----Mensaje original-----
De: Sven Langkamp [mailto:sven.langkamp at gmail.com] 
Enviado el: Martes, 17 de Julio de 2007 04:06 p.m.
Para: Krayon (KImageShop)
Asunto: Re: exactBounds

On 7/17/07, Casper Boemann <cbr at boemann.dk> wrote:
> On Tuesday 17 July 2007 19:45, Sven Langkamp wrote:
> > On 7/17/07, Casper Boemann <cbr at boemann.dk> wrote:
> > > On Tuesday 17 July 2007 13:27, Sven Langkamp wrote:
> > > > > KisPaintDevice::exactBounds is intented to return the bound of 
> > > > > the paint device, aka the rectangle where there are pixels on 
> > > > > the paint device,
> > >
> > > and
> > >
> > > > > it has allways been the case in 1.5/1.6, and if its different 
> > > > > in
> 2.0,
> > > > > then you have found a bug ;) . Beside, a paint device is not 
> > > > > necesseraly use with an image.
> > > >
> > > > In selectedExactRect there is (for defaultpixel != SELECTED_MIN):
> > > > exactBounds().unite(m_parentPaintDevice->exactBounds());
> > > > Which I think should return the image bounds.
> > >
> > > no it should return where there are affect _actual_ pixels. Which 
> > > is why we united we the actual pixels of the device when default 
> > > is not MIN
> > >
> > > Two kind of operations can be thought of:
> > >  - do stuff to every pixel selected. As in filling the entire
selection.
> > >  - do stuff with selected pixels. As in copying what you have 
> > > selected
> > >
> > > setDirty in your case is of the first kind. For that you need to 
> > > do some extra stuff yourself. Please don't change the method. I 
> > > however think there is another method called something like "does 
> > > this rect boud everything"
> > > that you might be able to use (this is off the top of my head 
> > > though)
> >
> > oops, I already changed it.
> Then please revert it, because lots of stuff depend on the old 
> behaviour
That stuff already broke before the change ;)

> > For example: If I do "select all" on an empty paintdevice the size 
> > of the paintdevice and the selection are 0, but filling the 
> > selection would fill the whole image.  In that case the image bounds 
> > have to be returned.
> Yeah AFTER you have filled it ;)
>
> but not at the point where you have only selected all. The code that 
> fills should look at the defaultPixel and possibly use the image 
> dimensions, but do NOT change selectedExactRect

That doesn't make sense to me. Why does filling change the selection size?
All pixels that are not inside the exact selection are defaultpixel, so why
is the unite needed?
_______________________________________________
kimageshop mailing list
kimageshop at kde.org
https://mail.kde.org/mailman/listinfo/kimageshop



--
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.10.8/904 - Release Date: 16/07/2007
05:42 p.m.




More information about the kimageshop mailing list