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