lyb-pixi-js 1.3.3 → 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.
@@ -4,7 +4,7 @@ import { Text, TextStyle } from "pixi.js";
4
4
  */
5
5
  export class LibPixiText extends Text {
6
6
  constructor(options) {
7
- const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeColor, strokeThickness, fontFamily = "MicrosoftYaHei", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", indent = 0, shadow, } = options;
7
+ const { text, fontSize = 36, fontColor = 0xffffff, stroke, strokeColor, strokeThickness, fontFamily = "Arial", fontWeight = "normal", wordWrap = false, wordWrapWidth = 100, lineHeight = 1.25, align = "left", indent = 0, shadow, } = options;
8
8
  const style = new TextStyle({
9
9
  fontSize,
10
10
  wordWrap,
@@ -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
- this._slideArea.y = this._offsetY + moveY;
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 结束拖动 */