More coding wtf goodness

I had another one of those moments tonight while getting the latest version of FMud packaged up for release. In the last version I made some changes to the way output was displayed that greatly improved the performance and usability of the client, however a side effect was that lines from the mud were now spaced further apart in the output window.

I tried several ways to change the text formatting. I couldn’t manually position the text within the window as I rely on the container to manage its contents for the scrolling to work properly however looking over the Flex documentation I noticed a verticalGap property that I could set on the container. This property sets the vertical spacing within the container. Just the ticket. I set this to zero and lo and behold the gap between lines was smaller, but it was still there.

I’d had several comments from people asking me to change it back to how it was, however there didn’t seem to be anything I could do to change the spacing as I’d already set the vertical gap to the minimum, and besides, the performance gains were such that there was no way I could go back to the old method.

Tonight while I was looking over the code before release I decided to have one last crack at it. I did a bit of research and was all ready to write a new class overriding the default text object that did some clever stuff with text line metrics when it hit me; verticalGap = “-5″. Problem solved.

Leave a comment