posted April 4th, 2008
Some programmers love bugs. Well, fixing them, at least.
That’s not me. I can’t stand bugs, nor can I stand fixing them. So instead I sequester them off on my to-do lists into giant Bug-a-thons, where, I swear to myself, I’ll fix ‘em all.
That doesn’t work out so well. After fixing a few bugs, I get burnt out, and have to find non-programming tasks to do. This of course, results in not only wasted time, but Bug-a-thons that turn into a week instead of a day, causing me to push back releases and ultimately simply ignore a bunch of the bugs.
So, for my sanity, I’m doing a bug a day. And the first one is with exporting images.
Export

Exporting used to not actually create an image. The preview would be blank, and no file would ever get saved.
This turned out to be two compound bugs. First, I had never told the Anatomy renderer what OpenGL context to use. This was fine in earlier betas, but would lead to buggy behavior and has since been fixed. Apparently, I didn’t fix it in all places.
I also was using an apparently deprecated code path. Apparently, I’ve reached the point in Naked light where I can deprecate code and totally forget about it. In any event, instead of rendering your composition and returning a bitmap, that code path was just returning nil—Objective-C speak for nothing. Objective-C has an often nice but occasionally irritating feature in that telling nil to do something doesn’t do anything, rather than generating an error. So when I told this nothing to draw itself, JPEG compress itself, or save itself to your hard disk, all I got was a whole lot of nothing.
Fixed!
Bonus Bug
There used to be an intermittent extra gap between the top of the library window and the first row of items.

Annoyingly, this gap would come and go as you zoomed in and out, causing all kinds of unsightly flickring. The gap was caused by a rounding error in the line of code that checks to see if a line was full. Literally, all it took to fix this bug was a carefully placed “+ 1.” Fixed.