iterator offset problem

Casper Boemann cbr at boemann.dk
Fri Mar 18 16:19:59 CET 2005


On Friday 18 March 2005 15:59, Boudewijn Rempt wrote:
> On Thursday 17 March 2005 23:16, Casper Boemann wrote:
> > On Thursday 17 March 2005 22:17, Bart Coppens wrote:
> > > On Thursday 17 March 2005 15:14, Casper Boemann wrote:
> > > > I just realised a place where the proposed layer offset iterator
> > > > coods break down.
> > > > When you make and iterator you do it with image coords
> > > > ..but when you query the iterator's  position you get device coords
> > > > So the iterator needs to be told the position which breaks
> > > > encapsulation
> > >
> > > Well, in that patch, the pixel iterators just save a pointer to the
> > > paint device they're constructed with. When the iterator returns a
> > > position, it queries the paint device for the offset, so it can return
> > > the position in image coords.
> >
> > Well yes that is a solution, but it is also a break of encapsulation, as
> > the datamanager and iterators should know nothing of paintdevices.
>
> Cannot we construct the iterators with the offset as parameters? That
> doesn't break encapsulation, much, and the factory methods in
> kispaintdevice don't need to change.
yes, lets do that.

Bart, I assume you do it.
-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list