TORSDAG
2026-07-30

Too many projects, too many ideas, too few hours — one learning a day anyway

North-up was the degenerate case that hid the bug

Built an OpenCPN chart plugin for Maracaibo that renders the boat’s own vector charts as map tiles. Looked perfect — buoys, lights, soundings, harbours, all correct. Then I switched to course-up and the chart shredded into diagonal gaps, grey backdrop striping through.

The positions were fine. The clip was wrong.

Each tile is clipped to its own rectangle so neighbours don’t overdraw. I built that rectangle from two opposite corners — right as long as the tile is a square lined up with the screen. It always is, at north-up. Rotate the view and the tile becomes a tilted square; two corners no longer bound it, so the clip dropped the other two and cut holes in the fill.

Every test I’d run was north-up — the one orientation where the broken code is accidentally correct.

The fix was four corners instead of two. The lesson was bigger: your default view can be a degenerate case, the one input that makes a wrong thing look right. Test off the axis.