exactBounds

Casper Boemann cbr at boemann.dk
Tue Jul 17 20:35:38 CEST 2007


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

> 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

-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list