[pr-feature][rendering] Retain window client aspect ratio when resizing #34
Loading…
Reference in a new issue
No description provided.
Delete branch "ggwp/Darner:feat/window-aspect-ratio"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fluxer ID: FomalhautCusimanse#7381
What it changes
Dragging any edge or corner of the windowed game let it stretch freely to arbitrary proportions, distorting the swap chain picture.
darner_gpu::swap_chain_size()and updates it whenever the host swap chain is created or resized (ResizeBuffers), so the window hook always locks to the live rendered aspect ratio (16:9, 21:9, etc.).lifecycle.rsas a fallback before the swap chain exists (cleaned up onWM_NCDESTROY).WM_SIZINGon top-level, on-screen windows inwindow_procviaretain_aspect_rect, subtracting live window chrome (GetWindowRectminusGetClientRect) so the client area keeps exact proportions, anchoring the opposite edge or corner across all 8WMSZ_*handles, and clamping to a proportional minimum size (160 px on the longer axis).DARNER_LOCK_ASPECT=0restores free stretching. Documented inREADME.md.How it was tested
39a15c0onmain(4a92569).cargo xtask policy: passed (542 files ok)cargo clippy -p darner-gpu -p darner-hle --all-targets --all-features --locked: passedcargo test -p darner-hle --locked lifecycle: passed (23 passed, 0 failed), including unit tests for all edges, corners, chrome offsets, minimum clamp, and a live Win32WM_SIZINGSendMessageWtestcargo test --workspace --lockedand multi-monitor DPI drag sweep were not run.Checklist
main.docs/asset-policy.md.Checked for overlap
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.