diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-08-18 12:26:32 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-08-19 15:45:17 -0700 |
commit | abc825e19b554afe68784866e708d0d458ab72e6 (patch) | |
tree | 7575caddcb2a8eee521fc2801d659e67614f11d6 | |
parent | 0a4f0e40ec6820a052ae8c68b3d58b1b300bb900 (diff) | |
download | qtlocation-mapboxgl-abc825e19b554afe68784866e708d0d458ab72e6.tar.gz |
[ios, macos] Detect zero edge insets more strictly
Edges shouldn’t be able to cancel out other edges, so a summation is inappropriate here.
-rw-r--r-- | platform/darwin/scripts/generate-style-code.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index c7dace62a9..36c5e55c37 100644 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -176,7 +176,7 @@ global.describeValue = function (value, property, layerType) { units = ` ${units}`.replace(/pixel/, 'point'); } if (property.name.indexOf('padding') !== -1) { - if (value.reduce((a, b) => a + b, 0) === 0) { + if (value[0] === 0 && value[1] === 0 && value[2] === 0 && value[3] === 0) { return '`NSEdgeInsetsZero` or `UIEdgeInsetsZero`'; } return `${value[0]}${units} on the top, ${value[3]}${units} on the left, ${value[2]}${units} on the bottom, and ${value[1]}${units} on the right`; |