-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Fix dequeue view variable scope #7423
Conversation
@boundsj, thanks for your PR! By analyzing this pull request, we identified @1ec5, @incanus and @friedbunny to be potential reviewers. |
@@ -4799,7 +4799,7 @@ - (void)updateAnnotationViews | |||
(coordinate.longitude < upperLeftCoordinate.longitude || coordinate.longitude > lowerRightCoordinate.longitude)) | |||
{ | |||
CGRect adjustedFrame = annotationView.frame; | |||
adjustedFrame.origin.x = -CGRectGetWidth(adjustedFrame) * 2.0; | |||
adjustedFrame.origin.x = -CGRectGetWidth(adjustedFrame) * 10.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated but taking this opportunity to increase the size of this buffer.
d63f084
to
258cc43
Compare
toCoordinateFromView:self]; | ||
CLLocationCoordinate2D northeastCoordinate = [self convertPoint:{viewWidth + largestWidth, -largestHeight} | ||
toCoordinateFromView:self]; | ||
MGLCoordinateBounds coordinateBounds = {southwestCoordinate, northeastCoordinate}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code could use UIEdgeInsetsInsetRect()
to apply a slop area around the map view’s bounds, then convert it using -convertRect:toCoordinateBoundsFromView:
.
} | ||
else | ||
{ | ||
annotationView.center = [self convertCoordinate:annotationContext.annotation.coordinate toPointToView:self]; | ||
CGRect adjustedFrame = annotationView.frame; | ||
adjustedFrame.origin.x = -CGRectGetWidth(adjustedFrame) * 10.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this formula?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the concern is that a view might have a layer that overshoots the official bounds of the view and would thus peek out from the top edge of the map view, you could perhaps move the view so that its layer.presentationLayer.frame
lies outside the map view.
Thanks @1ec5 |
Fixes #7342
cc @1ec5 @frederoni