Skip to content

Let each side of camera paddings be left out - #40

Merged
wf9a5m75 merged 1 commit into
developfrom
feat/partial-paddings
Nov 12, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
feat/partial-paddings

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Summary

Each side of MapCameraPosition.paddings (top, left, bottom, right) can be left out. When the camera is applied (moveCameraTo(camera), via resolvedOnto), a side left out takes the same side of the current camera's paddings; an explicit 0 stays 0. Leaving paddings out altogether still means zero on all sides, and an initial camera (never resolved) reads 0 for a side left out. Reading a side always gives a number, so providers are unchanged.

New on MapPaddings: isTopSpecified / isLeftSpecified / isBottomSpecified / isRightSpecified, isFullySpecified, and a resolve-onto-current helper. Same rule and names on web, Android and iOS.

Commits

  • Let each side of MapCameraPosition.paddings be left unset

MapPaddings(top:left:bottom:right:) takes optional sides. An unset side reads 0, and MapCameraPosition.resolved(onto:) - what moveCameraTo applies - fills it from the same side of the state's current paddings, so MapPaddings(top: 300) changes the top and keeps the other three. An explicit 0 is used as given; omitting paddings altogether still means zero on every side. isTopSpecified/isLeftSpecified/isBottomSpecified/isRightSpecified and isFullySpecified tell the two apart, from() keeps them, and the fully-specified fast path now also requires every side.
@wf9a5m75
wf9a5m75 merged commit 3152e38 into develop Nov 12, 2026
2 checks passed
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