streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.9k stars 357 forks source link

Weird camera behavior after closing edit history #4302

Closed Helium314 closed 2 years ago

Helium314 commented 2 years ago

How to Reproduce

  1. edit something to have a non-empty edit history
  2. pan the map so the edited element is off screen
  3. open edit history (camera moves to have edit in view)
  4. close edit history (camera does not change)
  5. try moving to my position using the pointer pin or location/GPS button, and see it does nothing

Expected Behavior

The camera should move to my location on 5. And actually I think the camera should move back to where it was in 2. after 4., but it does stay.

This bug is possibly what @mnalis observed in https://github.com/streetcomplete/StreetComplete/issues/4258#issuecomment-1200468756

Versions affected

Android 9, LineageOS16.0 StreetComplete 45.2

mnalis commented 2 years ago

Yes, I can reproduce it in upstream v45.2 on Android 10 (EMUI 11.0.0) too

westnordost commented 2 years ago

It does not follow the position because geometryMapComponent?.isZoomedToContainGeometry falsely returns true.

https://github.com/streetcomplete/StreetComplete/blob/e67d1eb9107949162f5bc6a5b475631189a6d9ca/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MainMapFragment.kt#L255-L257