@zaofan/dsh-qqbot 1.5.9 → 1.5.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.
@@ -1734,8 +1734,13 @@ var QQS_CSS = ".qqs-btn{font:inherit;color:#333;background:linear-gradient(180de
1734
1734
  var badge = wrap.querySelector('#qqs-dock-badge')
1735
1735
  var panel = null
1736
1736
  var open = false
1737
- if (pos) { wrap.style.left = pos.x + 'px'; wrap.style.top = pos.y + 'px'; wrap.style.right = 'auto'; wrap.style.bottom = 'auto' }
1738
- // 拖拽(球上按住移动; 单击与拖拽区分)
1737
+ // ⚠️ 2026-09-27 修复「拖到屏幕外后球永久消失」:拖拽时本来有 clamp(行1749),
1738
+ // 但**读取上次位置时没有** —— 窗口变小/换显示器后,存的坐标会落在可视区外,
1739
+ // 球就再也点不到了(用户只能手动清 localStorage 才能找回)。这里读取时同样 clamp。
1740
+ var _bw = 60, _bh = 60
1741
+ var _x = Math.max(0, Math.min(Math.max(0, window.innerWidth - _bw), Number(pos.x) || 0))
1742
+ var _y = Math.max(0, Math.min(Math.max(0, window.innerHeight - _bh), Number(pos.y) || 0))
1743
+ wrap.style.left = _x + 'px'; wrap.style.top = _y + 'px'; wrap.style.right = 'auto'; wrap.style.bottom = 'auto'
1739
1744
  var dragState = null
1740
1745
  ball.addEventListener('mousedown', function (e) {
1741
1746
  dragState = { sx: e.clientX, sy: e.clientY, ox: wrap.offsetLeft, oy: wrap.offsetTop, moved: false }