forked from 1b-agent/opencadstudio-upstream
The orthographic near/far span was ±1000x the camera distance, so zooming out ballooned the depth range and collapsed z-buffer precision: coincident solids, meshes and wires then flipped draw order (meshes drew in front of solids only when zoomed out, correct order when zoomed in). Size the depth half-range from the drawing's extent instead — the bbox diagonal on fit_to_bounds, the view height on a restored saved view — and hold it constant as the camera zooms, so precision no longer depends on distance. Falls back to the old distance-scaled range when unset. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>