Repository navigation
Let each side of camera paddings be left out - #40
Merged
Merged
Conversation
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.
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
Each side of
MapCameraPosition.paddings(top,left,bottom,right) can be left out. When the camera is applied (moveCameraTo(camera), viaresolvedOnto), a side left out takes the same side of the current camera's paddings; an explicit 0 stays 0. Leavingpaddingsout 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