The bounding box calculation for aperture macro primitives ignored
rotation on most primitive types, producing bounding boxes that were
too small for rotated shapes. The cairo renderer's viewport culling
optimization then skipped rendering these elements at zoom levels
where they should have been visible. GDK "fast" mode was unaffected
because it does not use bounding box culling.
Apply rotation via gerbv_rotate_coord() for:
- Outline (type 4): rotate each vertex before min/max calculation
- LINE20 (type 20): rotate start/end points
- LINE21 (type 21): rotate center offset
- LINE22 (type 22): rotate computed center offset
- Polygon (type 5): rotate center offset
- Moire (type 6): rotate center offset
- Thermal (type 7): rotate center offset
Circle was already correct (rotation applied since original code).
Fixes gerbv#208.
Summary
The bounding box calculation for aperture macro primitives ignored rotation on most primitive types, producing bounding boxes that were too small for rotated shapes. The cairo renderer's viewport culling optimization (
draw.c:1159) then skipped rendering these elements at zoom levels where they should have been visible.GDK "fast" mode was unaffected because it does not use bounding box culling. SVG/PDF export was also affected since it uses the same cairo rendering path.
Changes
Apply
gerbv_rotate_coord()to primitive coordinates before bounding box calculation, matching what the cairo draw code already does when rendering:Circle was already correct (rotation applied in original code).
Test plan
develop)error_test_v2.gbxfrom Display not all data in all zoom stages #208 — rotated aperture macros should now be visible at all zoom levels in cairo normal modeFixes #208.