mapbox-maps-android
mapbox-maps-android copied to clipboard
Wrong `BitmapWidget` position after calling `updateBitmap` with a `Bitmap` that has different size
When you call updateBitmap
widget is updated in a way that keeps center point in the same location. But that means that parameters that were passed to BitmapWidget
constructor are no longer respected. For example in this video I created a widget with WidgetPosition(WidgetPosition.Horizontal.CENTER, WidgetPosition.Vertical.BOTTOM)
and marginY = 50f
. But you can see that bottom margin changes every time you call updateBitmap
.
https://user-images.githubusercontent.com/2395284/180738315-a77781ae-5a3a-4d92-b02d-701f196dacae.mov
If instead of updating an old widget you create a new one every time, then margins are respected, but I noticed that widget is not properly centered horizontally. Looks like it is actually the right border of the widget that is centered instead of the whole widget. This may be another issue.
https://user-images.githubusercontent.com/2395284/180738356-b15a562c-1679-445f-8ae0-53722c5002c4.mov
I pushed vz-update-position-issue
branch that reproduces both of these issues.
cc @mapbox/maps-android @kmadsen
@yunikkk will you take a look at this? appears to be an issue with the widget renderer
cc: @pengdev
Yes I'll take a look, thanks for reporting