diff options
author | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-12-13 16:43:39 -0800 |
---|---|---|
committer | Fabian Guerra <fabian.guerra@mapbox.com> | 2018-12-13 16:45:54 -0800 |
commit | 5984fdec1451d485d2fc4d329944980f4c056891 (patch) | |
tree | 4245a2c70f34540d8159b6bcda6dfdb1dacb2e88 /platform/darwin/src/MGLConversion.h | |
parent | e86d1b2ac99452819396e2e617a77b2918cd5a04 (diff) | |
download | qtlocation-mapboxgl-5984fdec1451d485d2fc4d329944980f4c056891.tar.gz |
[ios, macos] Fix number conversions when expressions cast to large numbers.upstream/fabian-conversion-13527
Diffstat (limited to 'platform/darwin/src/MGLConversion.h')
-rw-r--r-- | platform/darwin/src/MGLConversion.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLConversion.h b/platform/darwin/src/MGLConversion.h index 9057ed7824..7050b4febf 100644 --- a/platform/darwin/src/MGLConversion.h +++ b/platform/darwin/src/MGLConversion.h @@ -85,7 +85,7 @@ public: static optional<float> toNumber(const Holder& holder) { const id value = holder.value; if (_isNumber(value)) { - return ((NSNumber *)value).floatValue; + return ((NSNumber *)value).doubleValue; } else { return {}; } @@ -119,7 +119,7 @@ public: return { *toString(holder) }; } else if (_isNumber(value)) { // Need to cast to a double here as the float is otherwise considered a bool... - return { static_cast<double>(*toNumber(holder)) }; + return { *toDouble(holder) }; } else { return {}; } |