mapbox-maps-android icon indicating copy to clipboard operation
mapbox-maps-android copied to clipboard

Wrong `BitmapWidget` position after calling `updateBitmap` with a `Bitmap` that has different size

Open Zayankovsky opened this issue 2 years ago • 2 comments

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

Zayankovsky avatar Jul 25 '22 09:07 Zayankovsky

@yunikkk will you take a look at this? appears to be an issue with the widget renderer

cc: @pengdev

kmadsen avatar Jul 25 '22 19:07 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

yunikkk avatar Jul 26 '22 10:07 yunikkk