Decrement operator for KisTiledHLineIterator

Bart Coppens kde at bartcoppens.be
Sun Apr 17 13:44:20 CEST 2005


On Sunday 17 April 2005 11:19, Casper Boemann wrote:
> I can't see any direct error. How do you use it?
>
> Please note that when ++ goes past the end (isDone becomes true) the
> iterator comes into a undefined state where you can't go back. Maybe thats
> what you are seeing.
>
> Also the -- does the same when going past the beginning. And there is not
> test for "is before start"
>
> It should be fixable though. Either not moving when out of bounds and
> getting back in the first time the opposite direction is moved. Or perhabs
> keep moving and just providing the isDone() and "is before start"()
Ah, I hadn't thought of that, probably that is indeed the problem. I start the 
iterator at some x,y coordinates, and then I move left until x = 0 or the 
color difference is too big. Then what I would need is something that lets 
the iterator be valid from (0,y) to (width,y), while I still can "start" it 
from a random (x,y) position.


More information about the kimageshop mailing list