@whitesev/utils 2.11.9 → 2.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.amd.js CHANGED
@@ -239,7 +239,7 @@ define((function () { 'use strict';
239
239
  const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
240
240
  const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
241
241
 
242
- const version = "2.11.9";
242
+ const version = "2.11.10";
243
243
 
244
244
  /* eslint-disable */
245
245
  // ==UserScript==
@@ -6208,6 +6208,10 @@ define((function () { 'use strict';
6208
6208
  if (typeof deviation !== "number" || Number.isNaN(deviation)) {
6209
6209
  deviation = 10;
6210
6210
  }
6211
+ // 最大值 2147483647
6212
+ // const maxZIndex = Math.pow(2, 31) - 1;
6213
+ // 比较值 2000000000
6214
+ const maxZIndexCompare = 2 * Math.pow(10, 9);
6211
6215
  /** 坐标偏移 */
6212
6216
  const positionDistance = 10;
6213
6217
  const defaultCalcPostion = [];
@@ -6302,9 +6306,14 @@ define((function () { 'use strict';
6302
6306
  left: maxRect.left,
6303
6307
  };
6304
6308
  }
6309
+ let calcZIndex = zIndex + deviation;
6310
+ if (calcZIndex >= maxZIndexCompare) {
6311
+ // 不要超过最大值
6312
+ calcZIndex = maxZIndexCompare;
6313
+ }
6305
6314
  return {
6306
6315
  /** 计算偏移量后的z-index值 */
6307
- zIndex: zIndex + deviation,
6316
+ zIndex: calcZIndex,
6308
6317
  /** 获取到的最大的z-index值 */
6309
6318
  originZIndex: zIndex,
6310
6319
  /** 拥有最大z-index的元素 */