forked from 1b-agent/opencadstudio-upstream
Debug output revealed the sheet viewport has id=0 (DWG reader never sets the field), scale=0.8965 (not ≈1.0, so the 0.02 tolerance missed it), and center=(0.0, 0.0) — exactly at the paper-space origin. In DWG format the overall/sheet viewport always has its center at the origin. Content viewports are placed at their actual paper positions and always have a non-zero center. Switching from the scale heuristic to the center-position check makes the detection reliable regardless of what scale value the sheet viewport happens to carry. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>