@wcardinal/wcardinal-ui 0.378.0 → 0.379.0

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.
@@ -3,5 +3,5 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { UtilSvgAtlasBuilder } from "../../util/util-svg-atlas-builder";
6
- export var DThemeDarkAtlas = new UtilSvgAtlasBuilder(512, 1, 3);
6
+ export var DThemeDarkAtlas = new UtilSvgAtlasBuilder(1024, 1, 3);
7
7
  //# sourceMappingURL=d-theme-dark-atlas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"d-theme-dark-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeDarkAtlas = new UtilSvgAtlasBuilder(512, 1, 3);\n"]}
1
+ {"version":3,"file":"d-theme-dark-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/dark/d-theme-dark-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeDarkAtlas = new UtilSvgAtlasBuilder(1024, 1, 3);\n"]}
@@ -3,5 +3,5 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  import { UtilSvgAtlasBuilder } from "../../util/util-svg-atlas-builder";
6
- export var DThemeWhiteAtlas = new UtilSvgAtlasBuilder(512, 1, 3);
6
+ export var DThemeWhiteAtlas = new UtilSvgAtlasBuilder(1024, 1, 3);
7
7
  //# sourceMappingURL=d-theme-white-atlas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"d-theme-white-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,gBAAgB,GAAG,IAAI,mBAAmB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeWhiteAtlas = new UtilSvgAtlasBuilder(512, 1, 3);\n"]}
1
+ {"version":3,"file":"d-theme-white-atlas.js","sourceRoot":"","sources":["../../../../../src/main/typescript/wcardinal/ui/theme/white/d-theme-white-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,CAAC,IAAM,gBAAgB,GAAG,IAAI,mBAAmB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { UtilSvgAtlasBuilder } from \"../../util/util-svg-atlas-builder\";\n\nexport const DThemeWhiteAtlas = new UtilSvgAtlasBuilder(1024, 1, 3);\n"]}
@@ -65,7 +65,7 @@ var DynamicAtlas = /** @class */ (function () {
65
65
  }
66
66
  };
67
67
  DynamicAtlas.prototype.calcCanvasWidth = function (data) {
68
- var result = 128;
68
+ var result = 512;
69
69
  for (var i = data.length - 1; 0 <= i; --i) {
70
70
  var datum = data[i];
71
71
  var size = Math.max(datum.frame.width, datum.frame.height);
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-atlas.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/dynamic-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC;IAUC,sBAAY,UAAkB;QAC7B,IAAM,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;QAEnC,IAAM,WAAW,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;YACjE,MAAM,EAAE,YAAY,CAAC,GAAG;YACxB,UAAU,YAAA;SACV,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG;YAClB,KAAK,EAAE,IAAI,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC;YACjE,KAAK,EAAE,IAAI,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,E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AG,IAAI,CAAC,EAAE;gBACf,OAAO,CAAC,CAAC;aACT;iBAAM;gBACN,OAAO,CAAC,CAAC,CAAC;aACV;SACD;aAAM;YACN,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE;gBACf,OAAO,CAAC,CAAC,CAAC;aACV;SACD;QAED,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YACpC,OAAO,CAAC,CAAC,CAAC;SACV;aAAM,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YAC3C,OAAO,CAAC,CAAC,CAAC;SACV;aAAM;YACN,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;SACrC;IACF,CAAC,CAAC;IACH,mBAAC;CAAA,AAlND,IAkNC;SAlNY,YAAY","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BaseTexture, MIPMAP_MODES, Texture } from \"pixi.js\";\nimport { DynamicAtlasItem } from \"./dynamic-atlas-item\";\nimport { DynamicAtlasItemEmpty } from \"./dynamic-atlas-item-empty\";\nimport { DynamicAtlasItemWhite } from \"./dynamic-atlas-item-white\";\n\nconst MAXIMUM_TEXTURE_SIZE = 4096;\n\nexport class DynamicAtlas {\n\tprotected static INSTANCE: DynamicAtlas | null;\n\n\tprotected _canvas: HTMLCanvasElement;\n\tprotected _sortedData: DynamicAtlasItem[];\n\tprotected _idToDatum: Record<string, DynamicAtlasItem>;\n\tprotected _baseTexture: BaseTexture;\n\tprotected _isDirty: boolean;\n\tprotected _predefined: Record<string, DynamicAtlasItem>;\n\n\tconstructor(resolution: number) {\n\t\tconst canvas = (this._canvas = document.createElement(\"canvas\"));\n\t\tcanvas.width = canvas.height = 256;\n\n\t\tconst baseTexture = (this._baseTexture = BaseTexture.from(canvas, {\n\t\t\tmipmap: MIPMAP_MODES.OFF,\n\t\t\tresolution\n\t\t}));\n\n\t\tthis._idToDatum = {};\n\t\tthis._sortedData = [];\n\t\tthis._predefined = {\n\t\t\tempty: new DynamicAtlasItemEmpty(\"empty\", 10, 10, 0, baseTexture),\n\t\t\twhite: new DynamicAtlasItemWhite(\"white\", 10, 10, 0, baseTexture)\n\t\t};\n\n\t\tthis._isDirty = true;\n\t}\n\n\tupdateFrames(width: number, data: DynamicAtlasItem[]): number {\n\t\tconst padding = 4;\n\t\tlet x = padding;\n\t\tlet y = padding;\n\t\tlet maxRowHeight = 0;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (width < x + datum.frame.width + padding) {\n\t\t\t\tx = padding;\n\t\t\t\ty += maxRowHeight + padding;\n\t\t\t\tmaxRowHeight = 0;\n\t\t\t}\n\t\t\tdatum.frame.x = x | 0;\n\t\t\tdatum.frame.y = y | 0;\n\t\t\tx += datum.frame.width + padding;\n\t\t\tmaxRowHeight = Math.max(maxRowHeight, datum.frame.height);\n\t\t}\n\n\t\tconst minHeight = y + maxRowHeight + padding;\n\t\tlet result = 256;\n\t\twhile (result < minHeight) {\n\t\t\tresult <<= 1;\n\t\t}\n\t\treturn Math.min(MAXIMUM_TEXTURE_SIZE, result);\n\t}\n\n\trenderFrames(width: number, height: number, data: DynamicAtlasItem[]): void {\n\t\tconst canvas = this._canvas;\n\t\tcanvas.width = width;\n\t\tcanvas.height = height;\n\t\tconst context = canvas.getContext(\"2d\");\n\t\tif (context != null) {\n\t\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\t\tconst datum = data[i];\n\t\t\t\tdatum.render(context);\n\t\t\t}\n\t\t}\n\t}\n\n\tapplyFrames(data: DynamicAtlasItem[]): void {\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tdatum.applyFrame();\n\t\t}\n\t}\n\n\tcalcCanvasWidth(data: DynamicAtlasItem[]): number {\n\t\tlet result = 128;\n\t\tfor (let i = data.length - 1; 0 <= i; --i) {\n\t\t\tconst datum = data[i];\n\t\t\tconst size = Math.max(datum.frame.width, datum.frame.height);\n\t\t\twhile (result < size) {\n\t\t\t\tresult <<= 1;\n\t\t\t}\n\t\t}\n\t\treturn Math.min(MAXIMUM_TEXTURE_SIZE, result << 1);\n\t}\n\n\tcleanup(data: DynamicAtlasItem[]): void {\n\t\tdata.sort(DynamicAtlas.ITEM_COMPARATOR);\n\t\tfor (let i = data.length - 1; 0 <= i; --i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (0 < datum.ref) {\n\t\t\t\tdata.length = i + 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tdata.length = 0;\n\t}\n\n\tbegin(): void {\n\t\tconst data = this._sortedData;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tdatum.ref = 0;\n\t\t}\n\n\t\tthis._isDirty = false;\n\t}\n\n\tend(): void {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst data = this._sortedData;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (datum.ref <= 0) {\n\t\t\t\tif (!(datum.id in this._predefined)) {\n\t\t\t\t\tdatum.destroy();\n\t\t\t\t}\n\t\t\t\tdelete idToDatum[datum.id];\n\t\t\t\tthis._isDirty = true;\n\t\t\t}\n\t\t}\n\t}\n\n\trepack(forcibly?: boolean): void {\n\t\tif (forcibly === true || this._isDirty) {\n\t\t\tthis._isDirty = false;\n\t\t\tconst data = this._sortedData;\n\t\t\tthis.cleanup(data);\n\t\t\tconst canvasWidth = this.calcCanvasWidth(data);\n\t\t\tconst canvasHeight = this.updateFrames(canvasWidth, data);\n\t\t\tthis.renderFrames(canvasWidth, canvasHeight, data);\n\t\t\tthis._baseTexture.setRealSize(canvasWidth, canvasHeight);\n\t\t\tthis.applyFrames(data);\n\t\t}\n\t}\n\n\tget(id: string): DynamicAtlasItem | null {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst datum = idToDatum[id];\n\t\tif (datum != null) {\n\t\t\tdatum.ref += 1;\n\t\t\treturn datum;\n\t\t} else {\n\t\t\tconst predefined = this._predefined[id];\n\t\t\tif (predefined != null) {\n\t\t\t\tthis.set(id, predefined);\n\t\t\t\treturn predefined;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tset(id: string, item: DynamicAtlasItem): DynamicAtlasItem | undefined {\n\t\tconst result = this._idToDatum[id];\n\t\titem.ref += 1;\n\t\tthis._idToDatum[id] = item;\n\t\tthis._sortedData.push(item);\n\t\tthis._isDirty = true;\n\t\treturn result;\n\t}\n\n\ttoDirty(): void {\n\t\tthis._isDirty = true;\n\t}\n\n\tgetDefaultTexture(): Texture {\n\t\treturn this.get(\"white\")!.texture;\n\t}\n\n\tgetBaseTexture(): BaseTexture {\n\t\treturn this._baseTexture;\n\t}\n\n\trelease(id: string): void {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst datum = idToDatum[id];\n\t\tif (datum != null) {\n\t\t\tdatum.ref -= 1;\n\t\t\tif (datum.ref <= 0) {\n\t\t\t\tif (!(datum.id in this._predefined)) {\n\t\t\t\t\tdatum.destroy();\n\t\t\t\t}\n\t\t\t\tdelete idToDatum[id];\n\t\t\t\tthis._isDirty = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic ITEM_COMPARATOR = (a: DynamicAtlasItem, b: DynamicAtlasItem): number => {\n\t\tif (a.ref <= 0) {\n\t\t\tif (b.ref <= 0) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn +1;\n\t\t\t}\n\t\t} else {\n\t\t\tif (b.ref <= 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tif (a.frame.height < b.frame.height) {\n\t\t\treturn -1;\n\t\t} else if (b.frame.height < a.frame.height) {\n\t\t\treturn +1;\n\t\t} else {\n\t\t\treturn a.frame.width - b.frame.width;\n\t\t}\n\t};\n}\n"]}
1
+ {"version":3,"file":"dynamic-atlas.js","sourceRoot":"","sources":["../../../../src/main/typescript/wcardinal/ui/util/dynamic-atlas.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAW,MAAM,SAAS,CAAC;AAE7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,IAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC;IAUC,sBAAY,UAAkB;QAC7B,IAAM,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;QAEnC,IAAM,WAAW,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE;YACjE,MAAM,EAAE,YAAY,CAAC,GAAG;YACxB,UAAU,YAAA;SACV,CAAC,CAAC,CAAC;QAEJ,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG;YAClB,KAAK,EAAE,IAAI,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC;YACjE,KAAK,EAAE,IAAI,qBAAqB,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,WAAW,CAAC;SACjE,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,mCAAY,GAAZ,UAAa,KAAa,EAAE,IAAwB;QACnD,IAAM,OAAO,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC,GAAG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,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YACpC,OAAO,CAAC,CAAC,CAAC;SACV;aAAM,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;YAC3C,OAAO,CAAC,CAAC,CAAC;SACV;aAAM;YACN,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;SACrC;IACF,CAAC,CAAC;IACH,mBAAC;CAAA,AAlND,IAkNC;SAlNY,YAAY","sourcesContent":["/*\n * Copyright (C) 2019 Toshiba Corporation\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { BaseTexture, MIPMAP_MODES, Texture } from \"pixi.js\";\nimport { DynamicAtlasItem } from \"./dynamic-atlas-item\";\nimport { DynamicAtlasItemEmpty } from \"./dynamic-atlas-item-empty\";\nimport { DynamicAtlasItemWhite } from \"./dynamic-atlas-item-white\";\n\nconst MAXIMUM_TEXTURE_SIZE = 4096;\n\nexport class DynamicAtlas {\n\tprotected static INSTANCE: DynamicAtlas | null;\n\n\tprotected _canvas: HTMLCanvasElement;\n\tprotected _sortedData: DynamicAtlasItem[];\n\tprotected _idToDatum: Record<string, DynamicAtlasItem>;\n\tprotected _baseTexture: BaseTexture;\n\tprotected _isDirty: boolean;\n\tprotected _predefined: Record<string, DynamicAtlasItem>;\n\n\tconstructor(resolution: number) {\n\t\tconst canvas = (this._canvas = document.createElement(\"canvas\"));\n\t\tcanvas.width = canvas.height = 256;\n\n\t\tconst baseTexture = (this._baseTexture = BaseTexture.from(canvas, {\n\t\t\tmipmap: MIPMAP_MODES.OFF,\n\t\t\tresolution\n\t\t}));\n\n\t\tthis._idToDatum = {};\n\t\tthis._sortedData = [];\n\t\tthis._predefined = {\n\t\t\tempty: new DynamicAtlasItemEmpty(\"empty\", 10, 10, 0, baseTexture),\n\t\t\twhite: new DynamicAtlasItemWhite(\"white\", 10, 10, 0, baseTexture)\n\t\t};\n\n\t\tthis._isDirty = true;\n\t}\n\n\tupdateFrames(width: number, data: DynamicAtlasItem[]): number {\n\t\tconst padding = 4;\n\t\tlet x = padding;\n\t\tlet y = padding;\n\t\tlet maxRowHeight = 0;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (width < x + datum.frame.width + padding) {\n\t\t\t\tx = padding;\n\t\t\t\ty += maxRowHeight + padding;\n\t\t\t\tmaxRowHeight = 0;\n\t\t\t}\n\t\t\tdatum.frame.x = x | 0;\n\t\t\tdatum.frame.y = y | 0;\n\t\t\tx += datum.frame.width + padding;\n\t\t\tmaxRowHeight = Math.max(maxRowHeight, datum.frame.height);\n\t\t}\n\n\t\tconst minHeight = y + maxRowHeight + padding;\n\t\tlet result = 256;\n\t\twhile (result < minHeight) {\n\t\t\tresult <<= 1;\n\t\t}\n\t\treturn Math.min(MAXIMUM_TEXTURE_SIZE, result);\n\t}\n\n\trenderFrames(width: number, height: number, data: DynamicAtlasItem[]): void {\n\t\tconst canvas = this._canvas;\n\t\tcanvas.width = width;\n\t\tcanvas.height = height;\n\t\tconst context = canvas.getContext(\"2d\");\n\t\tif (context != null) {\n\t\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\t\tconst datum = data[i];\n\t\t\t\tdatum.render(context);\n\t\t\t}\n\t\t}\n\t}\n\n\tapplyFrames(data: DynamicAtlasItem[]): void {\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tdatum.applyFrame();\n\t\t}\n\t}\n\n\tcalcCanvasWidth(data: DynamicAtlasItem[]): number {\n\t\tlet result = 512;\n\t\tfor (let i = data.length - 1; 0 <= i; --i) {\n\t\t\tconst datum = data[i];\n\t\t\tconst size = Math.max(datum.frame.width, datum.frame.height);\n\t\t\twhile (result < size) {\n\t\t\t\tresult <<= 1;\n\t\t\t}\n\t\t}\n\t\treturn Math.min(MAXIMUM_TEXTURE_SIZE, result << 1);\n\t}\n\n\tcleanup(data: DynamicAtlasItem[]): void {\n\t\tdata.sort(DynamicAtlas.ITEM_COMPARATOR);\n\t\tfor (let i = data.length - 1; 0 <= i; --i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (0 < datum.ref) {\n\t\t\t\tdata.length = i + 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tdata.length = 0;\n\t}\n\n\tbegin(): void {\n\t\tconst data = this._sortedData;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tdatum.ref = 0;\n\t\t}\n\n\t\tthis._isDirty = false;\n\t}\n\n\tend(): void {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst data = this._sortedData;\n\t\tfor (let i = 0, imax = data.length; i < imax; ++i) {\n\t\t\tconst datum = data[i];\n\t\t\tif (datum.ref <= 0) {\n\t\t\t\tif (!(datum.id in this._predefined)) {\n\t\t\t\t\tdatum.destroy();\n\t\t\t\t}\n\t\t\t\tdelete idToDatum[datum.id];\n\t\t\t\tthis._isDirty = true;\n\t\t\t}\n\t\t}\n\t}\n\n\trepack(forcibly?: boolean): void {\n\t\tif (forcibly === true || this._isDirty) {\n\t\t\tthis._isDirty = false;\n\t\t\tconst data = this._sortedData;\n\t\t\tthis.cleanup(data);\n\t\t\tconst canvasWidth = this.calcCanvasWidth(data);\n\t\t\tconst canvasHeight = this.updateFrames(canvasWidth, data);\n\t\t\tthis.renderFrames(canvasWidth, canvasHeight, data);\n\t\t\tthis._baseTexture.setRealSize(canvasWidth, canvasHeight);\n\t\t\tthis.applyFrames(data);\n\t\t}\n\t}\n\n\tget(id: string): DynamicAtlasItem | null {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst datum = idToDatum[id];\n\t\tif (datum != null) {\n\t\t\tdatum.ref += 1;\n\t\t\treturn datum;\n\t\t} else {\n\t\t\tconst predefined = this._predefined[id];\n\t\t\tif (predefined != null) {\n\t\t\t\tthis.set(id, predefined);\n\t\t\t\treturn predefined;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tset(id: string, item: DynamicAtlasItem): DynamicAtlasItem | undefined {\n\t\tconst result = this._idToDatum[id];\n\t\titem.ref += 1;\n\t\tthis._idToDatum[id] = item;\n\t\tthis._sortedData.push(item);\n\t\tthis._isDirty = true;\n\t\treturn result;\n\t}\n\n\ttoDirty(): void {\n\t\tthis._isDirty = true;\n\t}\n\n\tgetDefaultTexture(): Texture {\n\t\treturn this.get(\"white\")!.texture;\n\t}\n\n\tgetBaseTexture(): BaseTexture {\n\t\treturn this._baseTexture;\n\t}\n\n\trelease(id: string): void {\n\t\tconst idToDatum = this._idToDatum;\n\t\tconst datum = idToDatum[id];\n\t\tif (datum != null) {\n\t\t\tdatum.ref -= 1;\n\t\t\tif (datum.ref <= 0) {\n\t\t\t\tif (!(datum.id in this._predefined)) {\n\t\t\t\t\tdatum.destroy();\n\t\t\t\t}\n\t\t\t\tdelete idToDatum[id];\n\t\t\t\tthis._isDirty = true;\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic ITEM_COMPARATOR = (a: DynamicAtlasItem, b: DynamicAtlasItem): number => {\n\t\tif (a.ref <= 0) {\n\t\t\tif (b.ref <= 0) {\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn +1;\n\t\t\t}\n\t\t} else {\n\t\t\tif (b.ref <= 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\n\t\tif (a.frame.height < b.frame.height) {\n\t\t\treturn -1;\n\t\t} else if (b.frame.height < a.frame.height) {\n\t\t\treturn +1;\n\t\t} else {\n\t\t\treturn a.frame.width - b.frame.width;\n\t\t}\n\t};\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.378.0
2
+ Winter Cardinal UI v0.379.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -17,7 +17,7 @@
17
17
  * Copyright (C) 2019 Toshiba Corporation
18
18
  * SPDX-License-Identifier: Apache-2.0
19
19
  */
20
- var DThemeDarkAtlas = new UtilSvgAtlasBuilder(512, 1, 3);
20
+ var DThemeDarkAtlas = new UtilSvgAtlasBuilder(1024, 1, 3);
21
21
 
22
22
  /*
23
23
  * Copyright (C) 2019 Toshiba Corporation