forked from 1b-agent/opencadstudio-upstream
When the viewport got too narrow the top-left render-mode bar and the top-right ViewCube overlapped. Hide them adaptively, measuring the render bar's real width rather than guessing: - Wrap the render bar in DensitySwap, which measures its natural width every frame and swaps it for an empty spacer once it no longer fits the tile. Add report_width0 so it publishes that measured width to render_bar_w. - Compute viewcube_visible from that measured width: the cube shows only while bar_w + gap + cube region fits. This one flag drives the ViewCube nav/UCS widgets, the hover hit-test, and — threaded through build_viewports / build_viewport_for_pane / viewport_data_for — the GPU cube itself, which previously ignored the pane flag (show_viewcube was inst.active only), so the cube stayed while its surrounding widgets vanished. Result: the ViewCube gives way first, then the render bar once it too has no room — no overlap, sized to the bar's real width (which varies with the render-mode label, split buttons and tile count). Co-Authored-By: Claude Opus 4.8 <[email protected]>