Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46a13285 authored by Fynn Godau's avatar Fynn Godau
Browse files

Partially revert 90c175cc

Setting padding should not cause a camera update, otherwise apps that
set
map padding upon camera update (e.g. Zomato) loop infinitely.
parent 71452df4
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -468,9 +468,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG

    override fun setPadding(left: Int, top: Int, right: Int, bottom: Int) = afterInitialize { map ->
        Log.d(TAG, "setPadding: $left $top $right $bottom")
        CameraUpdateFactory.paddingTo(left.toDouble(), top.toDouble(), right.toDouble(), bottom.toDouble())
            .let { map.moveCamera(it) }

        map.setPadding(left, top, right, bottom)
        val fourDp = mapView?.context?.resources?.getDimension(R.dimen.maplibre_four_dp)?.toInt()
                ?: 0
        val ninetyTwoDp = mapView?.context?.resources?.getDimension(R.dimen.maplibre_ninety_two_dp)?.toInt()