diff --git a/.gitignore b/.gitignore index f73dec2..f24f085 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ package-lock.json Podfile.lock Package.resolved .env -test.sh \ No newline at end of file +test.sh +.vscode diff --git a/plugin/ios/Plugin/Map.swift b/plugin/ios/Plugin/Map.swift index 71e4a7d..7c921f4 100644 --- a/plugin/ios/Plugin/Map.swift +++ b/plugin/ios/Plugin/Map.swift @@ -182,8 +182,9 @@ public class Map { let width = Double((item as? UIScrollView)?.contentSize.width ?? 0) let actualHeight = round(height / 2) - let isWidthEqual = width == self.config.width - let isHeightEqual = actualHeight == self.config.height + let tolerance = 1.0 + let isWidthEqual = abs(width - self.config.width) <= tolerance + let isHeightEqual = abs(actualHeight - self.config.height) <= tolerance if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG { return item