Skip to content

Commit

Permalink
Fix for map crashing on certain IOS devices (ionic-team#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiannis-spyridakis committed Oct 16, 2024
1 parent 4062442 commit 15fdbf6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ package-lock.json
Podfile.lock
Package.resolved
.env
test.sh
test.sh
.vscode
5 changes: 3 additions & 2 deletions plugin/ios/Plugin/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 15fdbf6

Please sign in to comment.