You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix widget selection on high-DPI displays; remove 'hack' shader toggle
The widget-selection render pass drew into an FBO sized in Qt logical
(widget) coordinates but inherited whatever viewport was last set. Qt
sets the viewport to the physical framebuffer size (logical size times
devicePixelRatio) before each paintGL, so on high-DPI displays the
selection scene was rendered at devicePixelRatio scale relative to the
FBO and mouse coordinates, breaking shift-click widget picking.
The 'Viewer widget selection correction' preference compensated by
scaling NDC by 0.5 in the selection vertex shader (a uniform literally
named "hack"), which only worked for devicePixelRatio == 2 (e.g. Retina
Macs). It was wrong for standard displays (hence the toggle) and for
fractional scale factors (e.g. 125%/150% on Windows, common with Qt 6),
where neither setting worked.
Fix the root cause instead: explicitly set the viewport to the
selection FBO's size while rendering the selection pass, so clip space
maps onto the FBO 1:1 regardless of display scale, and restore the
previous viewport afterward. Remove the hack uniform, the
widgetSelectionCorrection preference, its settings entry, and the
preferences-dialog checkbox.
Fixes#2558
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments