The release of Mountain Lion brought an interesting bug in Codepoints to the surface that for some reason had never occurred on Lion.

In certain cases, the background for some rows were being drawn transparent (technically zero height, but the end result is transparency).

Details of the problem are below, but an update has already been submitted to the App Store to deal with this and an updated Retina icon has been included as well.

The problem: caching & assumptions

Each row in Codepoints has a gradient background drawn in code (forgive the formatting):

There is an assumption being made about the size of dirtyRect here, one that didn't seem to cause a problem on Lion for whatever reason.

If this code were simply generating a new background image gradient every time the background needed to be drawn in a row, there would be no problem here as far as correctness, it would always work.

But for performance reasons, it's caching that NSImage in an instance variable, and at times the cached version is not full height because dirtyRect is not always the full size of the row, occasionally it will be partial or zero height (likely when the row being drawn isn't on-screen yet). So a partial or zero height background image was being drawn into a fully visible row.

The result was that some rows appeared transparent (a zero height background is essentially no background), which then caused scroll and click events to pass through the transparent area to whatever was under it, causing issues with scrolling and clicking.

Instead the code now creates the background image ahead of time when each row view is created, using the actual size of the row, and then draws that into dirtyRect when the background needs to be drawn. This seems to have solved the problem :)