lyb-pixi-js 1.7.3 → 1.7.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.
@@ -1,5 +1,5 @@
1
1
  import { Container } from "pixi.js";
2
- import { LibPixiContainer } from '../Base/LibPixiContainer';
2
+ import { LibPixiContainer } from "../Base/LibPixiContainer";
3
3
  export interface LibPixiScrollContainerXParams {
4
4
  /** 宽度 */
5
5
  width: number;
@@ -7,8 +7,6 @@ export interface LibPixiScrollContainerXParams {
7
7
  height: number;
8
8
  /** 滚动内容 */
9
9
  scrollContent: Container;
10
- /** 底部内边距 */
11
- bottomMargin?: number;
12
10
  }
13
11
  /** @description 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
14
12
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollContainerX-X轴滚动容器
@@ -1,12 +1,12 @@
1
- import { Container, Graphics, Sprite, } from "pixi.js";
1
+ import { Container, Graphics } from "pixi.js";
2
2
  import { gsap } from "gsap";
3
- import { LibPixiContainer } from '../Base/LibPixiContainer';
3
+ import { LibPixiContainer } from "../Base/LibPixiContainer";
4
4
  /** @description 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
5
5
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollContainerX-X轴滚动容器
6
6
  */
7
7
  export class LibPixiScrollContainerX extends LibPixiContainer {
8
8
  constructor(params) {
9
- const { width, height, scrollContent, bottomMargin = 50 } = params;
9
+ const { width, height, scrollContent } = params;
10
10
  super(width, height);
11
11
  /** 开始位置 */
12
12
  this._startX = 0;
@@ -25,12 +25,6 @@ export class LibPixiScrollContainerX extends LibPixiContainer {
25
25
  this._content = new Container();
26
26
  this.addChild(this._content);
27
27
  this._content.addChild(this._scrollContent);
28
- // 创建底部占位
29
- if (bottomMargin > 0) {
30
- const bottom_box = new Sprite();
31
- this._content.addChild(bottom_box);
32
- bottom_box.x = this._content.width + bottomMargin;
33
- }
34
28
  // 创建遮罩
35
29
  this._maskGraphics = new Graphics();
36
30
  this.addChild(this._maskGraphics);
@@ -1,5 +1,5 @@
1
1
  import { Container } from "pixi.js";
2
- import { LibPixiContainer } from '../Base/LibPixiContainer';
2
+ import { LibPixiContainer } from "../Base/LibPixiContainer";
3
3
  export interface LibPixiScrollContainerYParams {
4
4
  /** 宽度 */
5
5
  width: number;
@@ -7,8 +7,6 @@ export interface LibPixiScrollContainerYParams {
7
7
  height: number;
8
8
  /** 滚动内容 */
9
9
  scrollContent: Container;
10
- /** 底部内边距 */
11
- bottomMargin?: number;
12
10
  }
13
11
  /** @description 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
14
12
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollContainerY-Y轴滚动容器
@@ -1,12 +1,12 @@
1
- import { Container, Graphics, Sprite, } from "pixi.js";
1
+ import { Container, Graphics } from "pixi.js";
2
2
  import { gsap } from "gsap";
3
- import { LibPixiContainer } from '../Base/LibPixiContainer';
3
+ import { LibPixiContainer } from "../Base/LibPixiContainer";
4
4
  /** @description 支持鼠标滚轮滚动、鼠标拖动、手指滑动,支持惯性滚动及回弹
5
5
  * @link 使用方法:https://www.npmjs.com/package/lyb-pixi-js#LibPixiScrollContainerY-Y轴滚动容器
6
6
  */
7
7
  export class LibPixiScrollContainerY extends LibPixiContainer {
8
8
  constructor(params) {
9
- const { width, height, scrollContent, bottomMargin = 50 } = params;
9
+ const { width, height, scrollContent } = params;
10
10
  super(width, height);
11
11
  /** 开始位置 */
12
12
  this._startY = 0;
@@ -25,12 +25,6 @@ export class LibPixiScrollContainerY extends LibPixiContainer {
25
25
  this._content = new Container();
26
26
  this.addChild(this._content);
27
27
  this._content.addChild(this._scrollContent);
28
- // 创建底部占位
29
- if (bottomMargin > 0) {
30
- const bottom_box = new Sprite();
31
- this._content.addChild(bottom_box);
32
- bottom_box.y = this._content.height + bottomMargin;
33
- }
34
28
  // 创建遮罩
35
29
  this._maskGraphics = new Graphics();
36
30
  this.addChild(this._maskGraphics);
package/README.md CHANGED
@@ -597,7 +597,6 @@ const scrollContainer = new LibPixiScrollContainerX({
597
597
  width: 800,
598
598
  height: 600,
599
599
  scrollContent: scrollContent,
600
- bottomMargin: 50, //可选:底部内边距
601
600
  });
602
601
 
603
602
  //添加到Pixi.js场景
@@ -628,7 +627,6 @@ const scrollContainer = new LibPixiScrollContainerY({
628
627
  width: 800,
629
628
  height: 600,
630
629
  scrollContent: scrollContent,
631
- bottomMargin: 50, //可选:底部内边距
632
630
  });
633
631
 
634
632
  //添加到Pixi.js场景
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 tag = 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$1 = Math.abs;
1702
1702
  var floor$1 = Math.floor;
1703
- var max$1 = Math.max;
1703
+ var max$2 = Math.max;
1704
1704
  var min$1 = Math.min;
1705
1705
  var pow$1 = Math.pow;
1706
1706
  var round$2 = Math.round;
@@ -1833,102 +1833,78 @@
1833
1833
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
1834
1834
  return Object_getPrototypeOf;
1835
1835
  }
1836
- var implementation;
1837
- var hasRequiredImplementation;
1838
- function requireImplementation() {
1839
- if (hasRequiredImplementation)
1840
- return implementation;
1841
- hasRequiredImplementation = 1;
1842
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
1843
- var toStr2 = Object.prototype.toString;
1844
- var max2 = Math.max;
1845
- var funcType = "[object Function]";
1846
- var concatty = function concatty2(a2, b2) {
1847
- var arr = [];
1848
- for (var i2 = 0; i2 < a2.length; i2 += 1) {
1849
- arr[i2] = a2[i2];
1850
- }
1851
- for (var j2 = 0; j2 < b2.length; j2 += 1) {
1852
- arr[j2 + a2.length] = b2[j2];
1853
- }
1854
- return arr;
1855
- };
1856
- var slicy = function slicy2(arrLike, offset) {
1857
- var arr = [];
1858
- for (var i2 = offset || 0, j2 = 0; i2 < arrLike.length; i2 += 1, j2 += 1) {
1859
- arr[j2] = arrLike[i2];
1860
- }
1861
- return arr;
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$1 = 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
- return str;
1872
- };
1873
- implementation = function bind2(that) {
1874
- var target = this;
1875
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
1876
- throw new TypeError(ERROR_MESSAGE + target);
1877
- }
1878
- var args = slicy(arguments, 1);
1879
- var bound;
1880
- var binder = function() {
1881
- if (this instanceof bound) {
1882
- var result = target.apply(
1883
- this,
1884
- concatty(args, arguments)
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
- var boundLength = max2(0, target.length - args.length);
1897
- var boundArgs = [];
1898
- for (var i2 = 0; i2 < boundLength; i2++) {
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 bound;
1885
+ return target.apply(
1886
+ that,
1887
+ concatty(args, arguments)
1888
+ );
1910
1889
  };
1911
- return implementation;
1912
- }
1913
- var functionBind;
1914
- var hasRequiredFunctionBind;
1915
- function requireFunctionBind() {
1916
- if (hasRequiredFunctionBind)
1917
- return functionBind;
1918
- hasRequiredFunctionBind = 1;
1919
- var implementation2 = requireImplementation();
1920
- functionBind = Function.prototype.bind || implementation2;
1921
- return functionBind;
1922
- }
1923
- var functionCall;
1924
- var hasRequiredFunctionCall;
1925
- function requireFunctionCall() {
1926
- if (hasRequiredFunctionCall)
1927
- return functionCall;
1928
- hasRequiredFunctionCall = 1;
1929
- functionCall = Function.prototype.call;
1930
- return functionCall;
1931
- }
1890
+ var boundLength = max$1(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 = requireFunctionBind();
1918
+ var bind$2 = functionBind;
1943
1919
  var $apply$1 = requireFunctionApply();
1944
- var $call$2 = requireFunctionCall();
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 = requireFunctionBind();
1923
+ var bind$1 = functionBind;
1948
1924
  var $TypeError$4 = type;
1949
- var $call$1 = requireFunctionCall();
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 = requireFunctionBind();
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 = abs$1;
2032
2008
  var floor = floor$1;
2033
- var max = max$1;
2009
+ var max = max$2;
2034
2010
  var min = min$1;
2035
2011
  var pow = pow$1;
2036
2012
  var round$1 = round$2;
@@ -2064,7 +2040,7 @@
2064
2040
  var $ObjectGPO = requireObject_getPrototypeOf();
2065
2041
  var $ReflectGPO = requireReflect_getPrototypeOf();
2066
2042
  var $apply = requireFunctionApply();
2067
- var $call = requireFunctionCall();
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 = requireFunctionBind();
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);
@@ -49116,7 +49092,7 @@ void main(void)\r
49116
49092
  }
49117
49093
  class LibPixiScrollContainerX extends LibPixiContainer {
49118
49094
  constructor(params) {
49119
- const { width, height, scrollContent, bottomMargin = 50 } = params;
49095
+ const { width, height, scrollContent } = params;
49120
49096
  super(width, height);
49121
49097
  this._startX = 0;
49122
49098
  this._velocity = 0;
@@ -49128,11 +49104,6 @@ void main(void)\r
49128
49104
  this._content = new Container();
49129
49105
  this.addChild(this._content);
49130
49106
  this._content.addChild(this._scrollContent);
49131
- if (bottomMargin > 0) {
49132
- const bottom_box = new Sprite();
49133
- this._content.addChild(bottom_box);
49134
- bottom_box.x = this._content.width + bottomMargin;
49135
- }
49136
49107
  this._maskGraphics = new Graphics();
49137
49108
  this.addChild(this._maskGraphics);
49138
49109
  this._maskGraphics.clear();
@@ -49252,7 +49223,7 @@ void main(void)\r
49252
49223
  }
49253
49224
  class LibPixiScrollContainerY extends LibPixiContainer {
49254
49225
  constructor(params) {
49255
- const { width, height, scrollContent, bottomMargin = 50 } = params;
49226
+ const { width, height, scrollContent } = params;
49256
49227
  super(width, height);
49257
49228
  this._startY = 0;
49258
49229
  this._velocity = 0;
@@ -49264,11 +49235,6 @@ void main(void)\r
49264
49235
  this._content = new Container();
49265
49236
  this.addChild(this._content);
49266
49237
  this._content.addChild(this._scrollContent);
49267
- if (bottomMargin > 0) {
49268
- const bottom_box = new Sprite();
49269
- this._content.addChild(bottom_box);
49270
- bottom_box.y = this._content.height + bottomMargin;
49271
- }
49272
49238
  this._maskGraphics = new Graphics();
49273
49239
  this.addChild(this._maskGraphics);
49274
49240
  this._maskGraphics.clear();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lyb-pixi-js",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "自用Pixi.JS方法库",
5
5
  "license": "ISC",
6
6
  "exports": {