Decrement operator for KisTiledHLineIterator

Casper Boemann cbr at boemann.dk
Sun Apr 17 10:23:55 CEST 2005


On Saturday 16 April 2005 17:14, Bart Coppens wrote:
> As I was looking if changing the algorithm of the flood fill to something
> stackbased could make it faster, I noticed the operator-- of the
> KisHLineIterator was not implemented.
> Attached is a patch, but I'm getting the impression that I made an error
> somewhere, because I'm getting very weird results with this code. Maybe
> someone could have a look at it?
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"()

-- 
best regards / venlig hilsen
Casper Boemann


More information about the kimageshop mailing list