Skip to content

fix: restore station-exterior zoom after interior visit (interior_zoom) - #349

Open
kcid9660 wants to merge 1 commit into
STFC-Mod:devfrom
kcid9660:pr/interior-zoom-restore
Open

kcid9660 wants to merge 1 commit into
STFC-Mod:devfrom
kcid9660:pr/interior-zoom-restore

Conversation

@kcid9660

Copy link
Copy Markdown
Contributor

Follow-up to #332. Rarely, the station exterior view could get stuck zoomed out at interior_zoom_scale with no zoom control normally available to recover it from exterior view. It turns out the provider gets recreated across transitions while the radius object it drives persists, so we key on the radius instead.

The interior zoom-out hook keyed its native-radius capture and restore by the
OrbitFrameProvider instance. That provider is recreated across scene/section
transitions, but the Constraint.FloatData radius object it drives persists and is
shared with the exterior station camera. When a widened provider was torn down
before it next ticked outside the interior, the widened radius was inherited by a
freshly created exterior provider the hook had never captured, so the restore
branch (find(provider) miss) never fired and the exterior stayed pinned at
scale*native: zoomed out and un-zoomable.

Key the capture and restore by the radius object instead of the provider, so any
provider that later presents that radius restores it to native on its first
exterior frame (and a stuck state self-heals). The map key stays compare-only and
the stored value is plain floats, so no stale-object access is introduced.

Follow-up to STFC-Mod#332.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant