@whitesev/utils 2.11.9 → 2.11.11

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.
@@ -240,7 +240,7 @@ var Utils = (function () {
240
240
  const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
241
241
  const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
242
242
 
243
- const version = "2.11.9";
243
+ const version = "2.11.11";
244
244
 
245
245
  /* eslint-disable */
246
246
  // ==UserScript==
@@ -6209,6 +6209,10 @@ var Utils = (function () {
6209
6209
  if (typeof deviation !== "number" || Number.isNaN(deviation)) {
6210
6210
  deviation = 10;
6211
6211
  }
6212
+ // 最大值 2147483647
6213
+ // const maxZIndex = Math.pow(2, 31) - 1;
6214
+ // 比较值 2000000000
6215
+ const maxZIndexCompare = 2 * Math.pow(10, 9);
6212
6216
  /** 坐标偏移 */
6213
6217
  const positionDistance = 10;
6214
6218
  const defaultCalcPostion = [];
@@ -6303,9 +6307,15 @@ var Utils = (function () {
6303
6307
  left: maxRect.left,
6304
6308
  };
6305
6309
  }
6310
+ const calcZIndex = zIndex + deviation;
6311
+ if (calcZIndex >= maxZIndexCompare) {
6312
+ // 不要超过最大值
6313
+ // 超过就忽略
6314
+ return;
6315
+ }
6306
6316
  return {
6307
6317
  /** 计算偏移量后的z-index值 */
6308
- zIndex: zIndex + deviation,
6318
+ zIndex: calcZIndex,
6309
6319
  /** 获取到的最大的z-index值 */
6310
6320
  originZIndex: zIndex,
6311
6321
  /** 拥有最大z-index的元素 */