[core] make padding optional when camera position is requested.
When padding is not provided, the current one that's cached in the TransformState is going to be returned.
This commit is contained in:
committed by
Łukasz Paczos
parent
6a4e431dbe
commit
e5c219d035
@@ -60,7 +60,7 @@ public:
|
||||
bool isPanning() const;
|
||||
|
||||
// Camera
|
||||
CameraOptions getCameraOptions(const EdgeInsets& = {}) const;
|
||||
CameraOptions getCameraOptions(optional<EdgeInsets> = {}) const;
|
||||
void jumpTo(const CameraOptions&);
|
||||
void easeTo(const CameraOptions&, const AnimationOptions&);
|
||||
void flyTo(const CameraOptions&, const AnimationOptions&);
|
||||
|
||||
@@ -124,7 +124,7 @@ bool Map::isPanning() const {
|
||||
|
||||
#pragma mark -
|
||||
|
||||
CameraOptions Map::getCameraOptions(const EdgeInsets& padding) const {
|
||||
CameraOptions Map::getCameraOptions(optional<EdgeInsets> padding) const {
|
||||
return impl->transform.getCameraOptions(padding);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ void Transform::resize(const Size size) {
|
||||
|
||||
#pragma mark - Camera
|
||||
|
||||
CameraOptions Transform::getCameraOptions(const EdgeInsets& padding) const {
|
||||
CameraOptions Transform::getCameraOptions(optional<EdgeInsets> padding) const {
|
||||
return state.getCameraOptions(padding);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
|
||||
// Camera
|
||||
/** Returns the current camera options. */
|
||||
CameraOptions getCameraOptions(const EdgeInsets&) const;
|
||||
CameraOptions getCameraOptions(optional<EdgeInsets>) const;
|
||||
|
||||
/** Instantaneously, synchronously applies the given camera options. */
|
||||
void jumpTo(const CameraOptions&);
|
||||
|
||||
@@ -146,10 +146,10 @@ ViewportMode TransformState::getViewportMode() const {
|
||||
|
||||
#pragma mark - Camera options
|
||||
|
||||
CameraOptions TransformState::getCameraOptions(const EdgeInsets& padding) const {
|
||||
CameraOptions TransformState::getCameraOptions(optional<EdgeInsets> padding) const {
|
||||
return CameraOptions()
|
||||
.withCenter(getLatLng())
|
||||
.withPadding(padding)
|
||||
.withPadding(padding ? padding : edgeInsets)
|
||||
.withZoom(getZoom())
|
||||
.withBearing(-bearing * util::RAD2DEG)
|
||||
.withPitch(pitch * util::RAD2DEG);
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
// Viewport mode
|
||||
ViewportMode getViewportMode() const;
|
||||
|
||||
CameraOptions getCameraOptions(const EdgeInsets&) const;
|
||||
CameraOptions getCameraOptions(optional<EdgeInsets>) const;
|
||||
|
||||
// Position
|
||||
LatLng getLatLng(LatLng::WrapMode = LatLng::Unwrapped) const;
|
||||
|
||||
Reference in New Issue
Block a user