lyb-pixi-js 1.12.26 → 1.12.28
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.
|
@@ -15,7 +15,7 @@ export class LibPixiArrangeLinearV2 extends Container {
|
|
|
15
15
|
}
|
|
16
16
|
/** @description 布局 */
|
|
17
17
|
layout() {
|
|
18
|
-
const { colNum = this._elementList.length, gap =
|
|
18
|
+
const { colNum = this._elementList.length, gap = 0, direction = "x", anchorX = 0, anchorY = 0, } = this._params;
|
|
19
19
|
let lastRowMax = 0; // 当前行(或列)的最大高度(或宽度),用于多行/多列换行时计算偏移
|
|
20
20
|
let rowOffset = 0; // 累计偏移量,控制换行后的整体偏移位置
|
|
21
21
|
this._elementList.forEach((item, index) => {
|
|
@@ -9,6 +9,12 @@ export interface LibPixiScrollContainerYParams {
|
|
|
9
9
|
scrollContent: Container;
|
|
10
10
|
/** 背景色,用于定位 */
|
|
11
11
|
bgColor?: string;
|
|
12
|
+
/** 自定义遮罩贴图 */
|
|
13
|
+
maskTexture?: Texture;
|
|
14
|
+
/** 遮罩X坐标 */
|
|
15
|
+
maskX?: number;
|
|
16
|
+
/** 遮罩Y坐标 */
|
|
17
|
+
maskY?: number;
|
|
12
18
|
/** 是否需要滚动条 */
|
|
13
19
|
scrollbar?: boolean;
|
|
14
20
|
/** 滚动靠右坐标 */
|
|
@@ -17,12 +23,6 @@ export interface LibPixiScrollContainerYParams {
|
|
|
17
23
|
scrollbarWidth?: number;
|
|
18
24
|
/** 滚动条颜色 */
|
|
19
25
|
scrollbarColor?: string;
|
|
20
|
-
/** 自定义遮罩贴图 */
|
|
21
|
-
maskTexture?: Texture;
|
|
22
|
-
/** 遮罩X坐标 */
|
|
23
|
-
maskX?: number;
|
|
24
|
-
/** 遮罩Y坐标 */
|
|
25
|
-
maskY?: number;
|
|
26
26
|
/** 滚动触发 */
|
|
27
27
|
onScroll?: (y: number) => void;
|
|
28
28
|
}
|
|
@@ -50,6 +50,10 @@ export declare class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
50
50
|
private _scrollbarRgiht;
|
|
51
51
|
/** 滚动条宽度 */
|
|
52
52
|
private _scrollbarWidth;
|
|
53
|
+
/** 上边距 */
|
|
54
|
+
private _topMargin;
|
|
55
|
+
/** 右边距元素 */
|
|
56
|
+
private _bottomMarginBox;
|
|
53
57
|
/** 滚动容器 */
|
|
54
58
|
_scrollContent: Container;
|
|
55
59
|
/** 遮罩 */
|
|
@@ -66,7 +70,7 @@ export declare class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
66
70
|
private _onScroll?;
|
|
67
71
|
constructor(params: LibPixiScrollContainerYParams);
|
|
68
72
|
/** @description 添加边距 */
|
|
69
|
-
addMargin(topMargin: number, bottomMargin
|
|
73
|
+
addMargin(topMargin: number, bottomMargin?: number): void;
|
|
70
74
|
/** @description 设置滚动容器可视区宽高
|
|
71
75
|
* @param width 宽度
|
|
72
76
|
* @param height 高度
|
|
@@ -76,6 +80,8 @@ export declare class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
76
80
|
scrollToTop(): void;
|
|
77
81
|
/** @description 往滚动内容添加元素 */
|
|
78
82
|
addContent(container: Container): void;
|
|
83
|
+
/** @description 更新右边距坐标 */
|
|
84
|
+
private _updateBottomMargin;
|
|
79
85
|
/** @description 按下 */
|
|
80
86
|
private _onDragStart;
|
|
81
87
|
/** @description 拖动 */
|
|
@@ -26,6 +26,8 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
26
26
|
this._scrollbarDragging = false;
|
|
27
27
|
/** 滚动条拖动偏移量 */
|
|
28
28
|
this._scrollbarDragOffset = 0;
|
|
29
|
+
/** 上边距 */
|
|
30
|
+
this._topMargin = 0;
|
|
29
31
|
this._scrollbarRgiht = scrollbarRgiht;
|
|
30
32
|
this._scrollbarWidth = scrollbarWidth;
|
|
31
33
|
this._scrollContent = scrollContent;
|
|
@@ -95,7 +97,8 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
99
|
/** @description 添加边距 */
|
|
98
|
-
addMargin(topMargin, bottomMargin) {
|
|
100
|
+
addMargin(topMargin, bottomMargin = topMargin) {
|
|
101
|
+
this._topMargin = topMargin;
|
|
99
102
|
if (topMargin) {
|
|
100
103
|
const topMarginBox = new Sprite();
|
|
101
104
|
this._content.addChild(topMarginBox);
|
|
@@ -103,10 +106,10 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
103
106
|
this._scrollContent.y += topMargin;
|
|
104
107
|
}
|
|
105
108
|
if (bottomMargin) {
|
|
106
|
-
|
|
107
|
-
this._content.addChild(
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
this._bottomMarginBox = new Sprite();
|
|
110
|
+
this._content.addChild(this._bottomMarginBox);
|
|
111
|
+
this._bottomMarginBox.height = bottomMargin;
|
|
112
|
+
this._bottomMarginBox.y = topMargin + this._scrollContent.height;
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
/** @description 设置滚动容器可视区宽高
|
|
@@ -118,6 +121,7 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
118
121
|
this._maskGraphics.height = height;
|
|
119
122
|
this.setSize(width, height);
|
|
120
123
|
this._scrollbar.x = width - (this._scrollbarRgiht || this._scrollbarWidth);
|
|
124
|
+
this._updateBottomMargin();
|
|
121
125
|
}
|
|
122
126
|
/** @description 返回顶部 */
|
|
123
127
|
scrollToTop() {
|
|
@@ -128,12 +132,16 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
128
132
|
addContent(container) {
|
|
129
133
|
this._scrollContent.addChild(container);
|
|
130
134
|
}
|
|
135
|
+
/** @description 更新右边距坐标 */
|
|
136
|
+
_updateBottomMargin() {
|
|
137
|
+
this._bottomMarginBox.x = this._topMargin + this._scrollContent.width;
|
|
138
|
+
}
|
|
131
139
|
/** @description 按下 */
|
|
132
140
|
_onDragStart(event) {
|
|
133
141
|
if (this._content.height <= this._maskGraphics.height)
|
|
134
142
|
return;
|
|
135
|
-
const
|
|
136
|
-
this._startY =
|
|
143
|
+
const { y } = event.getLocalPosition(this);
|
|
144
|
+
this._startY = y - this._content.y;
|
|
137
145
|
this._isDragging = true;
|
|
138
146
|
this._velocity = 0;
|
|
139
147
|
this._startTime = Date.now();
|
|
@@ -143,8 +151,8 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
|
|
|
143
151
|
/** @description 拖动 */
|
|
144
152
|
_onDragMove(event) {
|
|
145
153
|
if (this._isDragging) {
|
|
146
|
-
const
|
|
147
|
-
const newPosition =
|
|
154
|
+
const { y } = event.getLocalPosition(this);
|
|
155
|
+
const newPosition = y - this._startY;
|
|
148
156
|
this._content.y = newPosition;
|
|
149
157
|
this._updateScrollbar();
|
|
150
158
|
}
|
package/lyb-pixi.js
CHANGED
|
@@ -1315,7 +1315,7 @@
|
|
|
1315
1315
|
var ys = arrObjKeys(obj, inspect2);
|
|
1316
1316
|
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1317
1317
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
1318
|
-
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
1318
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
|
|
1319
1319
|
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
1320
1320
|
var tag2 = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
1321
1321
|
if (ys.length === 0) {
|
|
@@ -1337,25 +1337,25 @@
|
|
|
1337
1337
|
return $replace$1.call(String(s2), /"/g, """);
|
|
1338
1338
|
}
|
|
1339
1339
|
function isArray$3(obj) {
|
|
1340
|
-
return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1340
|
+
return toStr$1(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1341
1341
|
}
|
|
1342
1342
|
function isDate(obj) {
|
|
1343
|
-
return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1343
|
+
return toStr$1(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1344
1344
|
}
|
|
1345
1345
|
function isRegExp$1(obj) {
|
|
1346
|
-
return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1346
|
+
return toStr$1(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1347
1347
|
}
|
|
1348
1348
|
function isError(obj) {
|
|
1349
|
-
return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1349
|
+
return toStr$1(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1350
1350
|
}
|
|
1351
1351
|
function isString(obj) {
|
|
1352
|
-
return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1352
|
+
return toStr$1(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1353
1353
|
}
|
|
1354
1354
|
function isNumber(obj) {
|
|
1355
|
-
return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1355
|
+
return toStr$1(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1356
1356
|
}
|
|
1357
1357
|
function isBoolean(obj) {
|
|
1358
|
-
return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1358
|
+
return toStr$1(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj));
|
|
1359
1359
|
}
|
|
1360
1360
|
function isSymbol(obj) {
|
|
1361
1361
|
if (hasShammedSymbols) {
|
|
@@ -1391,7 +1391,7 @@
|
|
|
1391
1391
|
function has$3(obj, key) {
|
|
1392
1392
|
return hasOwn$1.call(obj, key);
|
|
1393
1393
|
}
|
|
1394
|
-
function toStr(obj) {
|
|
1394
|
+
function toStr$1(obj) {
|
|
1395
1395
|
return objectToString.call(obj);
|
|
1396
1396
|
}
|
|
1397
1397
|
function nameOf(f2) {
|
|
@@ -1700,7 +1700,7 @@
|
|
|
1700
1700
|
var uri = URIError;
|
|
1701
1701
|
var abs$2 = Math.abs;
|
|
1702
1702
|
var floor$2 = Math.floor;
|
|
1703
|
-
var max$
|
|
1703
|
+
var max$3 = Math.max;
|
|
1704
1704
|
var min$2 = Math.min;
|
|
1705
1705
|
var pow$2 = Math.pow;
|
|
1706
1706
|
var round$3 = Math.round;
|
|
@@ -1833,102 +1833,78 @@
|
|
|
1833
1833
|
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
1834
1834
|
return Object_getPrototypeOf;
|
|
1835
1835
|
}
|
|
1836
|
-
var
|
|
1837
|
-
var
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
var
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
var
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
var joiny = function(arr, joiner) {
|
|
1864
|
-
var str = "";
|
|
1865
|
-
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
1866
|
-
str += arr[i2];
|
|
1867
|
-
if (i2 + 1 < arr.length) {
|
|
1868
|
-
str += joiner;
|
|
1869
|
-
}
|
|
1836
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
1837
|
+
var toStr = Object.prototype.toString;
|
|
1838
|
+
var max$2 = Math.max;
|
|
1839
|
+
var funcType = "[object Function]";
|
|
1840
|
+
var concatty = function concatty2(a2, b2) {
|
|
1841
|
+
var arr = [];
|
|
1842
|
+
for (var i2 = 0; i2 < a2.length; i2 += 1) {
|
|
1843
|
+
arr[i2] = a2[i2];
|
|
1844
|
+
}
|
|
1845
|
+
for (var j2 = 0; j2 < b2.length; j2 += 1) {
|
|
1846
|
+
arr[j2 + a2.length] = b2[j2];
|
|
1847
|
+
}
|
|
1848
|
+
return arr;
|
|
1849
|
+
};
|
|
1850
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
1851
|
+
var arr = [];
|
|
1852
|
+
for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
|
|
1853
|
+
arr[j2] = arrLike[i2];
|
|
1854
|
+
}
|
|
1855
|
+
return arr;
|
|
1856
|
+
};
|
|
1857
|
+
var joiny = function(arr, joiner) {
|
|
1858
|
+
var str = "";
|
|
1859
|
+
for (var i2 = 0; i2 < arr.length; i2 += 1) {
|
|
1860
|
+
str += arr[i2];
|
|
1861
|
+
if (i2 + 1 < arr.length) {
|
|
1862
|
+
str += joiner;
|
|
1870
1863
|
}
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
);
|
|
1886
|
-
if (Object(result) === result) {
|
|
1887
|
-
return result;
|
|
1888
|
-
}
|
|
1889
|
-
return this;
|
|
1890
|
-
}
|
|
1891
|
-
return target.apply(
|
|
1892
|
-
that,
|
|
1864
|
+
}
|
|
1865
|
+
return str;
|
|
1866
|
+
};
|
|
1867
|
+
var implementation$1 = function bind2(that) {
|
|
1868
|
+
var target = this;
|
|
1869
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
1870
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
1871
|
+
}
|
|
1872
|
+
var args = slicy(arguments, 1);
|
|
1873
|
+
var bound;
|
|
1874
|
+
var binder = function() {
|
|
1875
|
+
if (this instanceof bound) {
|
|
1876
|
+
var result = target.apply(
|
|
1877
|
+
this,
|
|
1893
1878
|
concatty(args, arguments)
|
|
1894
1879
|
);
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
boundArgs[i2] = "$" + i2;
|
|
1900
|
-
}
|
|
1901
|
-
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
1902
|
-
if (target.prototype) {
|
|
1903
|
-
var Empty = function Empty2() {
|
|
1904
|
-
};
|
|
1905
|
-
Empty.prototype = target.prototype;
|
|
1906
|
-
bound.prototype = new Empty();
|
|
1907
|
-
Empty.prototype = null;
|
|
1880
|
+
if (Object(result) === result) {
|
|
1881
|
+
return result;
|
|
1882
|
+
}
|
|
1883
|
+
return this;
|
|
1908
1884
|
}
|
|
1909
|
-
return
|
|
1885
|
+
return target.apply(
|
|
1886
|
+
that,
|
|
1887
|
+
concatty(args, arguments)
|
|
1888
|
+
);
|
|
1910
1889
|
};
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
functionCall = Function.prototype.call;
|
|
1930
|
-
return functionCall;
|
|
1931
|
-
}
|
|
1890
|
+
var boundLength = max$2(0, target.length - args.length);
|
|
1891
|
+
var boundArgs = [];
|
|
1892
|
+
for (var i2 = 0; i2 < boundLength; i2++) {
|
|
1893
|
+
boundArgs[i2] = "$" + i2;
|
|
1894
|
+
}
|
|
1895
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
1896
|
+
if (target.prototype) {
|
|
1897
|
+
var Empty = function Empty2() {
|
|
1898
|
+
};
|
|
1899
|
+
Empty.prototype = target.prototype;
|
|
1900
|
+
bound.prototype = new Empty();
|
|
1901
|
+
Empty.prototype = null;
|
|
1902
|
+
}
|
|
1903
|
+
return bound;
|
|
1904
|
+
};
|
|
1905
|
+
var implementation = implementation$1;
|
|
1906
|
+
var functionBind = Function.prototype.bind || implementation;
|
|
1907
|
+
var functionCall = Function.prototype.call;
|
|
1932
1908
|
var functionApply;
|
|
1933
1909
|
var hasRequiredFunctionApply;
|
|
1934
1910
|
function requireFunctionApply() {
|
|
@@ -1939,14 +1915,14 @@
|
|
|
1939
1915
|
return functionApply;
|
|
1940
1916
|
}
|
|
1941
1917
|
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
1942
|
-
var bind$2 =
|
|
1918
|
+
var bind$2 = functionBind;
|
|
1943
1919
|
var $apply$1 = requireFunctionApply();
|
|
1944
|
-
var $call$2 =
|
|
1920
|
+
var $call$2 = functionCall;
|
|
1945
1921
|
var $reflectApply = reflectApply;
|
|
1946
1922
|
var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
|
|
1947
|
-
var bind$1 =
|
|
1923
|
+
var bind$1 = functionBind;
|
|
1948
1924
|
var $TypeError$4 = type;
|
|
1949
|
-
var $call$1 =
|
|
1925
|
+
var $call$1 = functionCall;
|
|
1950
1926
|
var $actualApply = actualApply;
|
|
1951
1927
|
var callBindApplyHelpers = function callBindBasic2(args) {
|
|
1952
1928
|
if (args.length < 1 || typeof args[0] !== "function") {
|
|
@@ -2015,7 +1991,7 @@
|
|
|
2015
1991
|
hasRequiredHasown = 1;
|
|
2016
1992
|
var call = Function.prototype.call;
|
|
2017
1993
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
2018
|
-
var bind2 =
|
|
1994
|
+
var bind2 = functionBind;
|
|
2019
1995
|
hasown = bind2.call(call, $hasOwn);
|
|
2020
1996
|
return hasown;
|
|
2021
1997
|
}
|
|
@@ -2030,7 +2006,7 @@
|
|
|
2030
2006
|
var $URIError = uri;
|
|
2031
2007
|
var abs$1 = abs$2;
|
|
2032
2008
|
var floor$1 = floor$2;
|
|
2033
|
-
var max$1 = max$
|
|
2009
|
+
var max$1 = max$3;
|
|
2034
2010
|
var min$1 = min$2;
|
|
2035
2011
|
var pow$1 = pow$2;
|
|
2036
2012
|
var round$2 = round$3;
|
|
@@ -2064,7 +2040,7 @@
|
|
|
2064
2040
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
2065
2041
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
2066
2042
|
var $apply = requireFunctionApply();
|
|
2067
|
-
var $call =
|
|
2043
|
+
var $call = functionCall;
|
|
2068
2044
|
var needsEval = {};
|
|
2069
2045
|
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
2070
2046
|
var INTRINSICS = {
|
|
@@ -2234,7 +2210,7 @@
|
|
|
2234
2210
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
2235
2211
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
2236
2212
|
};
|
|
2237
|
-
var bind =
|
|
2213
|
+
var bind = functionBind;
|
|
2238
2214
|
var hasOwn = requireHasown();
|
|
2239
2215
|
var $concat = bind.call($call, Array.prototype.concat);
|
|
2240
2216
|
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
@@ -49382,6 +49358,7 @@ void main(void)\r
|
|
|
49382
49358
|
this._isDragging = false;
|
|
49383
49359
|
this._scrollbarDragging = false;
|
|
49384
49360
|
this._scrollbarDragOffset = 0;
|
|
49361
|
+
this._topMargin = 0;
|
|
49385
49362
|
this._scrollbarRgiht = scrollbarRgiht;
|
|
49386
49363
|
this._scrollbarWidth = scrollbarWidth;
|
|
49387
49364
|
this._scrollContent = scrollContent;
|
|
@@ -49453,7 +49430,8 @@ void main(void)\r
|
|
|
49453
49430
|
});
|
|
49454
49431
|
}
|
|
49455
49432
|
/** @description 添加边距 */
|
|
49456
|
-
addMargin(topMargin, bottomMargin) {
|
|
49433
|
+
addMargin(topMargin, bottomMargin = topMargin) {
|
|
49434
|
+
this._topMargin = topMargin;
|
|
49457
49435
|
if (topMargin) {
|
|
49458
49436
|
const topMarginBox = new Sprite();
|
|
49459
49437
|
this._content.addChild(topMarginBox);
|
|
@@ -49461,10 +49439,10 @@ void main(void)\r
|
|
|
49461
49439
|
this._scrollContent.y += topMargin;
|
|
49462
49440
|
}
|
|
49463
49441
|
if (bottomMargin) {
|
|
49464
|
-
|
|
49465
|
-
this._content.addChild(
|
|
49466
|
-
|
|
49467
|
-
|
|
49442
|
+
this._bottomMarginBox = new Sprite();
|
|
49443
|
+
this._content.addChild(this._bottomMarginBox);
|
|
49444
|
+
this._bottomMarginBox.height = bottomMargin;
|
|
49445
|
+
this._bottomMarginBox.y = topMargin + this._scrollContent.height;
|
|
49468
49446
|
}
|
|
49469
49447
|
}
|
|
49470
49448
|
/** @description 设置滚动容器可视区宽高
|
|
@@ -49476,6 +49454,7 @@ void main(void)\r
|
|
|
49476
49454
|
this._maskGraphics.height = height;
|
|
49477
49455
|
this.setSize(width, height);
|
|
49478
49456
|
this._scrollbar.x = width - (this._scrollbarRgiht || this._scrollbarWidth);
|
|
49457
|
+
this._updateBottomMargin();
|
|
49479
49458
|
}
|
|
49480
49459
|
/** @description 返回顶部 */
|
|
49481
49460
|
scrollToTop() {
|
|
@@ -49486,12 +49465,16 @@ void main(void)\r
|
|
|
49486
49465
|
addContent(container) {
|
|
49487
49466
|
this._scrollContent.addChild(container);
|
|
49488
49467
|
}
|
|
49468
|
+
/** @description 更新右边距坐标 */
|
|
49469
|
+
_updateBottomMargin() {
|
|
49470
|
+
this._bottomMarginBox.x = this._topMargin + this._scrollContent.width;
|
|
49471
|
+
}
|
|
49489
49472
|
/** @description 按下 */
|
|
49490
49473
|
_onDragStart(event) {
|
|
49491
49474
|
if (this._content.height <= this._maskGraphics.height)
|
|
49492
49475
|
return;
|
|
49493
|
-
const
|
|
49494
|
-
this._startY =
|
|
49476
|
+
const { y: y2 } = event.getLocalPosition(this);
|
|
49477
|
+
this._startY = y2 - this._content.y;
|
|
49495
49478
|
this._isDragging = true;
|
|
49496
49479
|
this._velocity = 0;
|
|
49497
49480
|
this._startTime = Date.now();
|
|
@@ -49501,8 +49484,8 @@ void main(void)\r
|
|
|
49501
49484
|
/** @description 拖动 */
|
|
49502
49485
|
_onDragMove(event) {
|
|
49503
49486
|
if (this._isDragging) {
|
|
49504
|
-
const
|
|
49505
|
-
const newPosition =
|
|
49487
|
+
const { y: y2 } = event.getLocalPosition(this);
|
|
49488
|
+
const newPosition = y2 - this._startY;
|
|
49506
49489
|
this._content.y = newPosition;
|
|
49507
49490
|
this._updateScrollbar();
|
|
49508
49491
|
}
|
|
@@ -58457,7 +58440,7 @@ void main(void){
|
|
|
58457
58440
|
layout() {
|
|
58458
58441
|
const {
|
|
58459
58442
|
colNum = this._elementList.length,
|
|
58460
|
-
gap =
|
|
58443
|
+
gap = 0,
|
|
58461
58444
|
direction = "x",
|
|
58462
58445
|
anchorX = 0,
|
|
58463
58446
|
anchorY = 0
|