Skip to content

Fix saved snapshot aspect ratio to match preview - #6385

Merged
akleshchev merged 1 commit into
secondlife:developfrom
Hecklezz:fix/snapshot_aspectratio
Sep 29, 2026
Merged

akleshchev merged 1 commit into
secondlife:developfrom
Hecklezz:fix/snapshot_aspectratio

Conversation

@Hecklezz

Copy link
Copy Markdown
Contributor

Issue Fixed: #6382

This PR simply fixes snapshots at a different aspect ratio than the viewer's window, which was causing the snapshot to be zoomed out compared to the preview. It does this by adjusting the camera's field of view to match the preview's crop without broadcasting it to the simulator.

Additionally, I also made sure the camera and screen buffer are always restored afterward AND when an early return happens. Previously, if an early return was hit and reset_deferred was true, it never restored them.

Note:
if (image_aspect > window_aspect) is done on purpose because from my own testing, if the aspect ratio is smaller than the window, such as doing a vertically tall snapshot, the issue did not occur.

Screenshots of the change working: secondlife-bin_2026-09-29_05-48-03 Test_2026-09-29_05135601_2026-09-29_05480701 secondlife-bin_2026-09-29_05-48-13 Test_2026-09-29_05135601_2026-09-29_05481901

@github-actions github-actions Bot added the c/cpp label Sep 28, 2026

@marchcat marchcat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The aspect-ratio calculation and cleanup paths are consistent and correctly scoped.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns saved snapshots with their preview framing when using wider aspect ratios.

Changes:

  • Adjusts the temporary camera FOV for wide snapshots without simulator broadcasts.
  • Centralizes restoration of camera and deferred-rendering state, including failure paths.
File Description
indra/​newview/​llviewerwindow.cpp Corrects wide snapshot framing and reliably restores temporary rendering state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@akleshchev
akleshchev merged commit 599ad85 into secondlife:develop Sep 29, 2026
16 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Saved file different from a snapshot preview

4 participants