Skip to content

Commit 8536bb2

Browse files
committed
fix(ios): fixed getTargetContainer calculation
1 parent 7f92c3d commit 8536bb2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugin/ios/Plugin/Map.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ public class Map {
180180

181181
let height = Double((item as? UIScrollView)?.contentSize.height ?? 0)
182182
let width = Double((item as? UIScrollView)?.contentSize.width ?? 0)
183-
let actualHeight = round(height / 2)
183+
let actualHeightFloor = floor(height / 2)
184+
let actualHeightCeil = ceil(height / 2)
184185

185-
let isWidthEqual = width == self.config.width
186-
let isHeightEqual = actualHeight == self.config.height
186+
let isWidthEqual = width == refWidth
187+
let isHeightEqual = actualHeightFloor == refHeight || actualHeightCeil == refHeight
187188

188189
if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG {
189190
return item

0 commit comments

Comments
 (0)