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

Commit 6fc4928c authored by Fynn Godau's avatar Fynn Godau
Browse files

Merge branch '907-padding-mapupdate' into 'master'

Avoid infinite loop on set padding

See merge request !75
parents e795d926 46a13285
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -481,9 +481,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()