lyb-pixi-js 1.3.4 → 1.3.5
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/Components/Custom/LibPixiScrollNum.js +10 -1
- package/lyb-pixi.js +71 -71
- package/package.json +1 -1
|
@@ -113,7 +113,16 @@ export class LibPixiScrollNum extends LibPixiContainer {
|
|
|
113
113
|
if (!this._isDragging)
|
|
114
114
|
return;
|
|
115
115
|
const moveY = event.pageY - this._startY;
|
|
116
|
-
|
|
116
|
+
let newY = this._offsetY + moveY;
|
|
117
|
+
// 限制滑动区域的上下边界
|
|
118
|
+
const minY = this._scrollHeight / 2;
|
|
119
|
+
const maxY = -this._pageNum * this._slideHeight + this._scrollHeight / 2;
|
|
120
|
+
// 如果超出上下边界,禁止拖动
|
|
121
|
+
if (newY > minY)
|
|
122
|
+
newY = minY;
|
|
123
|
+
if (newY < maxY)
|
|
124
|
+
newY = maxY;
|
|
125
|
+
this._slideArea.y = newY;
|
|
117
126
|
(_a = this._scrollCallback) === null || _a === void 0 ? void 0 : _a.call(this, this._slideArea.y, this._currentIndex);
|
|
118
127
|
}
|
|
119
128
|
/** @description 结束拖动 */
|