diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-06-28 21:54:05 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-07-05 18:33:00 -0700 |
commit | b83f9be12088ef7ebd231e49db8b0bc76095429b (patch) | |
tree | c8e978ef0af61654d2557878633dc5b4d88c9abd /platform/ios/src/MGLAnnotationView.mm | |
parent | 3d255176c549f96a17d05c8e5240067f7c2ad0f4 (diff) | |
download | qtlocation-mapboxgl-upstream/1ec5-annotation-cleanup.tar.gz |
[ios] More experimentsupstream/1ec5-annotation-cleanup
Diffstat (limited to 'platform/ios/src/MGLAnnotationView.mm')
-rw-r--r-- | platform/ios/src/MGLAnnotationView.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm index 7eed337702..1fc3bc44e9 100644 --- a/platform/ios/src/MGLAnnotationView.mm +++ b/platform/ios/src/MGLAnnotationView.mm @@ -243,7 +243,12 @@ CATransform3D MGLTransform3DFromMatrix4(GLKMatrix4 matrix) { freeTransform.m34 = -1.0 / (1.0 - furthestDistance * 0.5); freeTransform = CATransform3DRotate(freeTransform, MGLRadiansFromDegrees(camera.pitch), -1.0, 0, 0); -// self.layer.anchorPoint = [self convertPoint:self.superview.center toView:self]; + CGPoint anchorPoint = [self convertPoint:self.superview.center toView:self]; + anchorPoint.x -= self.center.x; + anchorPoint.x /= CGRectGetWidth(self.bounds); + anchorPoint.y -= self.center.y; + anchorPoint.y /= CGRectGetHeight(self.bounds); + self.layer.anchorPoint = anchorPoint; } // if (camera.heading >= 0 && (self.freeAxes & MGLAnnotationViewBillboardAxisY)) // { |