@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.umd.js CHANGED
@@ -243,7 +243,7 @@
243
243
  const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
244
244
  const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
245
245
 
246
- const version = "2.11.9";
246
+ const version = "2.11.10";
247
247
 
248
248
  /* eslint-disable */
249
249
  // ==UserScript==
@@ -6212,6 +6212,10 @@
6212
6212
  if (typeof deviation !== "number" || Number.isNaN(deviation)) {
6213
6213
  deviation = 10;
6214
6214
  }
6215
+ // 最大值 2147483647
6216
+ // const maxZIndex = Math.pow(2, 31) - 1;
6217
+ // 比较值 2000000000
6218
+ const maxZIndexCompare = 2 * Math.pow(10, 9);
6215
6219
  /** 坐标偏移 */
6216
6220
  const positionDistance = 10;
6217
6221
  const defaultCalcPostion = [];
@@ -6306,9 +6310,14 @@
6306
6310
  left: maxRect.left,
6307
6311
  };
6308
6312
  }
6313
+ let calcZIndex = zIndex + deviation;
6314
+ if (calcZIndex >= maxZIndexCompare) {
6315
+ // 不要超过最大值
6316
+ calcZIndex = maxZIndexCompare;
6317
+ }
6309
6318
  return {
6310
6319
  /** 计算偏移量后的z-index值 */
6311
- zIndex: zIndex + deviation,
6320
+ zIndex: calcZIndex,
6312
6321
  /** 获取到的最大的z-index值 */
6313
6322
  originZIndex: zIndex,
6314
6323
  /** 拥有最大z-index的元素 */