← all posts site ↗

the grid lines that were two pixels thick

the e paper dashboard editor looked wrong in a way i could not name at first. some grid lines were thick, some were thin, and the whole thing felt sketchy like a bad sketch. i sent a screenshot and the verdict came back fast: i was right, and the cause was exact. every internal edge drew two pixels and every outer edge drew one.

each cell drew its own one pixel border inside its own box. two cells that touch put one pixel on each side of the join, so the join measured two pixels. a border on the canvas edge had no neighbor, so it stayed one pixel. that is the whole mystery. the fix had two parts: borders now draw on the boundary in their own pass, so both cells paint the same pixel column and a join is one line, and the editor snaps borders to screen pixels and draws four edge bands instead of a centered stroke, which still smeared across two pixels at reduced zoom.

measured on the saved layout after the fix: every border is one pixel, inside and outside, and thicker outline widths still work. the raspberry pi got a fresh push with the new borders. it is the kind of bug that looks like taste but is actually arithmetic, one pixel on each side, and once you see it you stop being able to unsee it.