Repository navigation
Add MapCameraPosition.fov and padding emulation - #41
Merged
Merged
Conversation
fov is the vertical field of view, in degrees, of the camera the provider actually renders with, for the current map size. 0 means the tilt is drawn without perspective; null means unknown or the map cannot tilt. Like visibleRegion it is filled when the camera is read and ignored on moves; copy keeps it and equals ignores it. Core holds no fov value: each provider reports its own. CameraPaddingEmulation (driver API) lets a provider without a usable padding API honour MapCameraPosition.paddings by moving the camera center instead: the screen offset of the padded-area center, (L-R)/2 and (T-B)/2 dp, is solved on the ground with a pinhole camera for the provider's fov (orthographic for fov 0, flat for null), and inverted when the camera is read back. Unit tests check the result against an independent pinhole projection at tilt 0-60, three headings and three fovs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MapCameraPosition.fov: the vertical field of view of the camera as currently rendered (0= tilt drawn without perspective,null= unknown / the map cannot tilt). Each provider reports its own engine's value; core holds no default.paddingsfor engines without a native padding API: it moves the camera centre so the target sits at the centre of the padded area, using the provider's fov (pinhole camera for fov > 0, squashed plane for fov 0, plain pixel shift when unknown), plus the inverse for read-back.Provider PRs on
feat/camera-paddingsdepend on this one.Commits