Skip to content

Commit ebf62a1

Browse files
AE1NSA1Jan
andauthored
fix(ios): getTargetContainer calculation (#24)
Co-authored-by: [email protected] <[email protected]>
1 parent 08bc111 commit ebf62a1

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,13 @@ Supports markers of either either "legacy" or "advanced" types.
12741274
<code>google.maps.<a href="#marker">Marker</a> | google.maps.marker.AdvancedMarkerElement</code>
12751275

12761276

1277+
#### Marker
1278+
1279+
Supports markers of either either "legacy" or "advanced" types.
1280+
1281+
<code>google.maps.<a href="#marker">Marker</a> | google.maps.marker.AdvancedMarkerElement</code>
1282+
1283+
12771284
### Enums
12781285

12791286

plugin/ios/Plugin/Map.swift

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

209209
let height = Double((item as? UIScrollView)?.contentSize.height ?? 0)
210210
let width = Double((item as? UIScrollView)?.contentSize.width ?? 0)
211-
let actualHeight = round(height / 2)
211+
let actualHeightFloor = floor(height / 2)
212+
let actualHeightCeil = ceil(height / 2)
212213

213-
let isWidthEqual = width == self.config.width
214-
let isHeightEqual = actualHeight == self.config.height
214+
let isWidthEqual = width == refWidth
215+
let isHeightEqual = actualHeightFloor == refHeight || actualHeightCeil == refHeight
215216

216217
if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG {
217218
return item

0 commit comments

Comments
 (0)