Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ank27 committed Dec 2, 2022
1 parent ed0d69f commit eea6a1d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ internal class ViewAnnotationManagerImpl(
var west: Pair<ViewAnnotationOptions, Rect?>? = null
var south: Pair<ViewAnnotationOptions, Rect?>? = null

// we run the loop twice to adjust bounds correctly to fit all the annotations.
// we run the loop twice to optimize bounds correctly to fit all the annotations. this might not
// provide correct results when map is pitched or have bearing.
var boundsCounter = 1
while (!isCorrectBound && boundsCounter <= MAX_ADJUST_BOUNDS_COUNTER) {
val zoom = cameraOptionForCoordinates.zoom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class ViewAnnotationManagerAddTest(
every { viewAnnotationsLayout.addView(any()) } just Runs
every { viewAnnotationsLayout.removeView(any()) } just Runs
every { viewAnnotationsLayout.context } returns mockk()
val displayMetrics = DisplayMetrics().also { it.density = 1f }
val displayMetrics = DisplayMetrics().apply { density = 1f }
every { mapView.resources.displayMetrics } returns displayMetrics
viewAnnotationManager = ViewAnnotationManagerImpl(mapView, viewAnnotationsLayout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ViewAnnotationManagerTest {
every { viewAnnotationsLayout.layoutParams = any() } just Runs
every { viewAnnotationsLayout.removeView(any()) } just Runs
every { mapboxMap.addViewAnnotation(any(), any()) } returns ExpectedFactory.createNone()
val displayMetrics = DisplayMetrics().also { it.density = 1f }
val displayMetrics = DisplayMetrics().apply { density = 1f }
every { mapView.resources.displayMetrics } returns displayMetrics
viewAnnotationManager = ViewAnnotationManagerImpl(mapView, viewAnnotationsLayout)
every { mapboxMap.style } returns style
Expand Down

0 comments on commit eea6a1d

Please sign in to comment.