-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core] center still offset incorrectly with content insets #15344
Comments
Based on the problem description, this code behaves as expected: padding moves all content, and center (and perspective center if pitch is used) to content area defined by padding. #15130 was about offset in selecting annotations, it didn't affect how content is rendered (rendering offset). Padding on iOS is used always because of top bar - so that the center is in visible area. Then, if there are other UI elements overlaid on sides, e.g. turn by turn navigation, padding is used to center the content to non occluded area of screen. What might be causing issue is that, insets are defined in logical screen coordinates, as opposite to using physical - the customer in this case might have just the vale that is too high. Without knowing the value set in code above, it is hard to tell. |
Thanks @astojilj. I’ll email them and make sure they see it. Let’s say that they had this same code and the same implementation back when they were on |
#14664 introduced persistent nature of padding - earlier, set padding was reset to 0 after the transition and new center was calculated (padding was baked into center coordinate). As padding defines content area, asymmetric viewport center and vanishing point, it had to be set as persistent. After #14664, center coordinate and padding are separate, and if there is a need to reset padding, there should be an explicit call from client code to do it. Note that padding, as other camera properties are, is animated when using easeTo/flyTo. |
Thanks @astojilj. Closing this ticket, will re-open if it's needed. |
I'm re-opening this issue because as of 5.0.0 setting mapbox-gl-native/platform/ios/src/MGLMapView.h Lines 1306 to 1310 in 39af6b4
Starting |
@fabian-guerra @chloekraw @1ec5 Let's move this to another issue and not reopen this one, please. @fabian-guerra that content above doesnt mean that value in centerCoordinate gets altered when you change contentInset. It is just rendered on different place. |
Customer reported a bug with the center being offset incorrectly when setting the camera with the
release-oolong
branch. Likely related to #15106, maybe #14991.We expected #15130 to resolve this regression but this fix has already been backported to
oolong
in #15176.Customer suspects it's from this part of their code:
Problems reported with the map:
The text was updated successfully, but these errors were encountered: