[core, ios, osx] Tilt around visual center point

The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
This commit is contained in:
Minh Nguyễn
2016-01-26 16:59:54 -08:00
committed by Minh Nguyễn
parent 97fc2120c4
commit 8a23bdcd01
7 changed files with 30 additions and 6 deletions

View File

@@ -523,12 +523,17 @@ double Transform::getAngle() const {
#pragma mark - Pitch
void Transform::setPitch(double pitch, const Duration& duration) {
setPitch(pitch, {NAN, NAN}, duration);
}
void Transform::setPitch(double pitch, const PrecisionPoint& anchor, const Duration& duration) {
if (std::isnan(pitch)) {
return;
}
CameraOptions camera;
camera.pitch = pitch;
camera.anchor = anchor;
easeTo(camera, duration);
}