Console crashing after 31 lines

Kali

14-11-2007 12:24:49

I've taken the liberty of finding the problem.

QuickGUIConsole.cpp:57

int numLinesOfText = mTextList->getNumberOfItems();
while(numLinesOfText > mMaxLines)
mTextList->removeItem(0);


removeItem does remove the first item but numLinesOfText is never decreased so it goes on to remove the next and ends up in an endless loop. it should be:


int numLinesOfText = mTextList->getNumberOfItems();
while(numLinesOfText > mMaxLines) {
mTextList->removeItem(0);
numLinesOfText--;
}

Kali

14-11-2007 13:14:11

There is also a strange issue, when you pass mMaxLines and you scroll back to the first few lines, there is some extra spacing between the first few elements.

I couldn't immediatly find a cause for this, moving the elements upward in removeItem seems correct.

And while you're at it a setMaxLines() function would be convenient.

kungfoomasta

14-11-2007 17:23:55

Thanks for the feedback, I will add in your code fix and add a setMaxLines function.

One of the problems I was tackling a while back, and didn't finish it, was setting a minimum Slider height/width on the scroll bar. Can you also confirm the Slider gets smaller and smaller as you add more items? (it will get smaller to the point where you can't grab it.. I think it will crash eventually) I think I had the solution for this, but I lost it. Hopefully it won't be hard to implement.

kungfoomasta

15-11-2007 08:26:46

I applied your changes to my code base, thanks for posting them. I'm getting close to committing to SVN, but I have 2 design decisions I'd like to make. If you have any problems with them be sure to post. :)