@wcardinal/wcardinal-ui 0.155.0 → 0.158.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.
- package/dist/types/wcardinal/ui/d-application-layer-like.d.ts +0 -1
- package/dist/types/wcardinal/ui/d-application-layer.d.ts +0 -2
- package/dist/types/wcardinal/ui/d-base.d.ts +11 -12
- package/dist/types/wcardinal/ui/d-diagram-snapshot.d.ts +0 -2
- package/dist/types/wcardinal/ui/d-image-base.d.ts +2 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-bottom.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-center.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-container.d.ts +25 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-left.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-middle.d.ts +6 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-right.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part-top.d.ts +4 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter-part.d.ts +8 -0
- package/dist/types/wcardinal/ui/d-image-piece-layouter.d.ts +17 -0
- package/dist/types/wcardinal/ui/d-menu-sided.d.ts +1 -1
- package/dist/types/wcardinal/ui/d-text-base.d.ts +5 -5
- package/dist/types/wcardinal/ui/shape/variant/deserialize-connector-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/shape/variant/deserialize-line.d.ts +1 -1
- package/dist/types/wcardinal/ui/theme/dark/d-theme-dark-input.d.ts +1 -1
- package/dist/types/wcardinal/ui/theme/white/d-theme-white-input.d.ts +1 -1
- package/dist/wcardinal/ui/d-application-layer-like.js.map +1 -1
- package/dist/wcardinal/ui/d-application-layer.js +3 -21
- package/dist/wcardinal/ui/d-application-layer.js.map +1 -1
- package/dist/wcardinal/ui/d-base.js +126 -100
- package/dist/wcardinal/ui/d-base.js.map +1 -1
- package/dist/wcardinal/ui/d-diagram-snapshot.js +2 -18
- package/dist/wcardinal/ui/d-diagram-snapshot.js.map +1 -1
- package/dist/wcardinal/ui/d-html-element.js +0 -3
- package/dist/wcardinal/ui/d-html-element.js.map +1 -1
- package/dist/wcardinal/ui/d-image-base.js +9 -264
- package/dist/wcardinal/ui/d-image-base.js.map +1 -1
- package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js +31 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-bottom.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js +24 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-center.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js +158 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-container.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js +30 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-left.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js +24 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-middle.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js +31 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-right.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js +32 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part-top.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part.js +18 -0
- package/dist/wcardinal/ui/d-image-piece-layouter-part.js.map +1 -0
- package/dist/wcardinal/ui/d-image-piece-layouter.js +65 -0
- package/dist/wcardinal/ui/d-image-piece-layouter.js.map +1 -0
- package/dist/wcardinal/ui/d-menu-item-text.js +18 -2
- package/dist/wcardinal/ui/d-menu-item-text.js.map +1 -1
- package/dist/wcardinal/ui/d-menu-sided.js +2 -2
- package/dist/wcardinal/ui/d-menu-sided.js.map +1 -1
- package/dist/wcardinal/ui/d-picker-color-gradient.js +6 -6
- package/dist/wcardinal/ui/d-picker-color-gradient.js.map +1 -1
- package/dist/wcardinal/ui/d-text-base.js +34 -24
- package/dist/wcardinal/ui/d-text-base.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-connector-line.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js +30 -0
- package/dist/wcardinal/ui/shape/variant/deserialize-embedded.js.map +1 -1
- package/dist/wcardinal/ui/shape/variant/deserialize-line.js.map +1 -1
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js +2 -2
- package/dist/wcardinal/ui/theme/dark/d-theme-dark-input.js.map +1 -1
- package/dist/wcardinal/ui/theme/white/d-theme-white-input.js +2 -2
- package/dist/wcardinal/ui/theme/white/d-theme-white-input.js.map +1 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js +3 -1
- package/dist/wcardinal/ui/util/dynamic-font-atlas-font.js.map +1 -1
- package/dist/wcardinal-ui-theme-dark.js +3 -3
- package/dist/wcardinal-ui-theme-dark.min.js +2 -2
- package/dist/wcardinal-ui-theme-dark.min.js.map +1 -1
- package/dist/wcardinal-ui-theme-white.js +3 -3
- package/dist/wcardinal-ui-theme-white.min.js +2 -2
- package/dist/wcardinal-ui-theme-white.min.js.map +1 -1
- package/dist/wcardinal-ui.cjs.js +785 -611
- package/dist/wcardinal-ui.js +781 -607
- package/dist/wcardinal-ui.min.js +2 -2
- package/dist/wcardinal-ui.min.js.map +1 -1
- package/package.json +1 -1
package/dist/wcardinal-ui.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Winter Cardinal UI v0.
|
|
2
|
+
Winter Cardinal UI v0.158.0
|
|
3
3
|
Copyright (C) 2019 Toshiba Corporation
|
|
4
4
|
SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
|
|
@@ -12162,7 +12162,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12162
12162
|
_this._auto = new DBaseAutoSet();
|
|
12163
12163
|
_this._isDirty = true;
|
|
12164
12164
|
_this._hasDirty = false;
|
|
12165
|
-
_this.
|
|
12165
|
+
_this._isHierarchyDirty = false;
|
|
12166
12166
|
_this._shadow = null;
|
|
12167
12167
|
_this.name = (_a = options === null || options === void 0 ? void 0 : options.name) !== null && _a !== void 0 ? _a : "";
|
|
12168
12168
|
var theme = toTheme(options) || _this.getThemeDefault();
|
|
@@ -12172,7 +12172,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12172
12172
|
_this._clearType = toEnum((_b = options === null || options === void 0 ? void 0 : options.clear) !== null && _b !== void 0 ? _b : theme.getClearType(), DLayoutClearType);
|
|
12173
12173
|
_this._padding = new DBasePadding(theme, options, function () {
|
|
12174
12174
|
_this.toParentResized();
|
|
12175
|
-
_this.
|
|
12175
|
+
_this.toHierarchyDirty();
|
|
12176
12176
|
DApplications.update(_this);
|
|
12177
12177
|
});
|
|
12178
12178
|
var toDirtyAndUpdate = function () {
|
|
@@ -12301,8 +12301,8 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12301
12301
|
if (_this.isDirty() || _this.hasDirty()) {
|
|
12302
12302
|
_this.toParentHasDirty();
|
|
12303
12303
|
}
|
|
12304
|
-
if (_this.
|
|
12305
|
-
_this.
|
|
12304
|
+
if (_this._isHierarchyDirty) {
|
|
12305
|
+
_this.toParentHierarchyDirty();
|
|
12306
12306
|
}
|
|
12307
12307
|
var newParent = _this.parent;
|
|
12308
12308
|
if (newParent instanceof DBase) {
|
|
@@ -12394,7 +12394,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12394
12394
|
new DBaseReflowableImpl(this);
|
|
12395
12395
|
};
|
|
12396
12396
|
DBase.prototype.onChildrenChange = function () {
|
|
12397
|
-
this.
|
|
12397
|
+
this.toHierarchyDirty();
|
|
12398
12398
|
_super.prototype.onChildrenChange.call(this);
|
|
12399
12399
|
};
|
|
12400
12400
|
DBase.prototype.onShortcut = function (e) {
|
|
@@ -12424,46 +12424,48 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12424
12424
|
DBase.prototype.resize = function (width, height) {
|
|
12425
12425
|
var oldWidth = this._width;
|
|
12426
12426
|
var oldHeight = this._height;
|
|
12427
|
-
var
|
|
12428
|
-
var
|
|
12429
|
-
|
|
12430
|
-
|
|
12427
|
+
var newWidth = width != null ? width : oldWidth;
|
|
12428
|
+
var newHeight = height != null ? height : oldHeight;
|
|
12429
|
+
var isWidthChanged = oldWidth !== newWidth;
|
|
12430
|
+
var isHeightChanged = oldHeight !== newHeight;
|
|
12431
|
+
if (isWidthChanged) {
|
|
12432
|
+
this._width = newWidth;
|
|
12431
12433
|
}
|
|
12432
|
-
if (
|
|
12433
|
-
this._height =
|
|
12434
|
+
if (isHeightChanged) {
|
|
12435
|
+
this._height = newHeight;
|
|
12434
12436
|
}
|
|
12435
|
-
var
|
|
12436
|
-
if (
|
|
12437
|
-
this.onResize(
|
|
12437
|
+
var isChanged = isWidthChanged || isHeightChanged;
|
|
12438
|
+
if (isChanged) {
|
|
12439
|
+
this.onResize(newWidth, newHeight, oldWidth, oldHeight);
|
|
12438
12440
|
}
|
|
12439
|
-
if (
|
|
12441
|
+
if (isWidthChanged) {
|
|
12440
12442
|
var scalarSet = this._scalarSet;
|
|
12441
12443
|
if (scalarSet.x != null) {
|
|
12442
|
-
var position = this.
|
|
12444
|
+
var position = this._position;
|
|
12443
12445
|
var parent_1 = this.getParentOfSize();
|
|
12444
12446
|
if (parent_1) {
|
|
12445
|
-
this.x = scalarSet.x(parent_1.width,
|
|
12447
|
+
this._position.x = scalarSet.x(parent_1.width, newWidth, parent_1.padding.getLeft(), position.x);
|
|
12446
12448
|
}
|
|
12447
12449
|
}
|
|
12448
12450
|
}
|
|
12449
|
-
if (
|
|
12451
|
+
if (isHeightChanged) {
|
|
12450
12452
|
var scalarSet = this._scalarSet;
|
|
12451
12453
|
if (scalarSet.y != null) {
|
|
12452
|
-
var position = this.
|
|
12454
|
+
var position = this._position;
|
|
12453
12455
|
var parent_2 = this.getParentOfSize();
|
|
12454
12456
|
if (parent_2) {
|
|
12455
|
-
this.y = scalarSet.y(parent_2.height,
|
|
12457
|
+
this._position.y = scalarSet.y(parent_2.height, newHeight, parent_2.padding.getTop(), position.y);
|
|
12456
12458
|
}
|
|
12457
12459
|
}
|
|
12458
12460
|
}
|
|
12459
|
-
return
|
|
12461
|
+
return isChanged;
|
|
12460
12462
|
};
|
|
12461
12463
|
DBase.prototype.getClearType = function () {
|
|
12462
12464
|
return this._clearType;
|
|
12463
12465
|
};
|
|
12464
12466
|
DBase.prototype.onResize = function (newWidth, newHeight, oldWidth, oldHeight) {
|
|
12465
12467
|
this.toDirty();
|
|
12466
|
-
this.
|
|
12468
|
+
this.toHierarchyDirty();
|
|
12467
12469
|
var padding = this._padding;
|
|
12468
12470
|
var children = this.children;
|
|
12469
12471
|
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
@@ -12496,7 +12498,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12496
12498
|
return this._position.x;
|
|
12497
12499
|
},
|
|
12498
12500
|
set: function (x) {
|
|
12499
|
-
this.
|
|
12501
|
+
this.setX(x);
|
|
12500
12502
|
},
|
|
12501
12503
|
enumerable: false,
|
|
12502
12504
|
configurable: true
|
|
@@ -12507,15 +12509,25 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12507
12509
|
return scalarSet.x;
|
|
12508
12510
|
}
|
|
12509
12511
|
else {
|
|
12510
|
-
return this.x;
|
|
12512
|
+
return this._position.x;
|
|
12511
12513
|
}
|
|
12512
12514
|
};
|
|
12513
12515
|
DBase.prototype.setX = function (x) {
|
|
12516
|
+
var scalarSet = this._scalarSet;
|
|
12514
12517
|
if (isNumber(x)) {
|
|
12515
|
-
|
|
12518
|
+
var position = this._position;
|
|
12519
|
+
if (position.x !== x) {
|
|
12520
|
+
scalarSet.x = undefined;
|
|
12521
|
+
position.x = x;
|
|
12522
|
+
}
|
|
12523
|
+
else {
|
|
12524
|
+
if (scalarSet.x !== undefined) {
|
|
12525
|
+
scalarSet.x = undefined;
|
|
12526
|
+
this.toParentResized();
|
|
12527
|
+
}
|
|
12528
|
+
}
|
|
12516
12529
|
}
|
|
12517
12530
|
else {
|
|
12518
|
-
var scalarSet = this._scalarSet;
|
|
12519
12531
|
var scalar = DScalarFunctions.position(x);
|
|
12520
12532
|
if (scalarSet.x !== scalar) {
|
|
12521
12533
|
scalarSet.x = scalar;
|
|
@@ -12529,7 +12541,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12529
12541
|
return this._position.y;
|
|
12530
12542
|
},
|
|
12531
12543
|
set: function (y) {
|
|
12532
|
-
this.
|
|
12544
|
+
this.setY(y);
|
|
12533
12545
|
},
|
|
12534
12546
|
enumerable: false,
|
|
12535
12547
|
configurable: true
|
|
@@ -12540,15 +12552,25 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12540
12552
|
return scalarSet.y;
|
|
12541
12553
|
}
|
|
12542
12554
|
else {
|
|
12543
|
-
return this.y;
|
|
12555
|
+
return this._position.y;
|
|
12544
12556
|
}
|
|
12545
12557
|
};
|
|
12546
12558
|
DBase.prototype.setY = function (y) {
|
|
12559
|
+
var scalarSet = this._scalarSet;
|
|
12547
12560
|
if (isNumber(y)) {
|
|
12548
|
-
|
|
12561
|
+
var position = this._position;
|
|
12562
|
+
if (position.y !== y) {
|
|
12563
|
+
scalarSet.y = undefined;
|
|
12564
|
+
position.y = y;
|
|
12565
|
+
}
|
|
12566
|
+
else {
|
|
12567
|
+
if (scalarSet.y !== undefined) {
|
|
12568
|
+
scalarSet.y = undefined;
|
|
12569
|
+
this.toParentResized();
|
|
12570
|
+
}
|
|
12571
|
+
}
|
|
12549
12572
|
}
|
|
12550
12573
|
else {
|
|
12551
|
-
var scalarSet = this._scalarSet;
|
|
12552
12574
|
var scalar = DScalarFunctions.position(y);
|
|
12553
12575
|
if (scalarSet.y !== scalar) {
|
|
12554
12576
|
scalarSet.y = scalar;
|
|
@@ -12562,21 +12584,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12562
12584
|
return this._width;
|
|
12563
12585
|
},
|
|
12564
12586
|
set: function (width) {
|
|
12565
|
-
|
|
12566
|
-
if (oldWidth !== width) {
|
|
12567
|
-
this._width = width;
|
|
12568
|
-
var height = this._height;
|
|
12569
|
-
this.onResize(width, height, oldWidth, height);
|
|
12570
|
-
// Layout
|
|
12571
|
-
var scalarSet = this._scalarSet;
|
|
12572
|
-
if (scalarSet.x != null) {
|
|
12573
|
-
var position = this.transform.position;
|
|
12574
|
-
var parent_3 = this.getParentOfSize();
|
|
12575
|
-
if (parent_3) {
|
|
12576
|
-
this.x = scalarSet.x(parent_3.width, width, parent_3.padding.getLeft(), position.x);
|
|
12577
|
-
}
|
|
12578
|
-
}
|
|
12579
|
-
}
|
|
12587
|
+
this.setWidth(width);
|
|
12580
12588
|
},
|
|
12581
12589
|
enumerable: false,
|
|
12582
12590
|
configurable: true
|
|
@@ -12589,15 +12597,34 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12589
12597
|
var isOn = auto.isOn;
|
|
12590
12598
|
var isAuto = auto.from(width);
|
|
12591
12599
|
if (auto.isOn !== isOn) {
|
|
12592
|
-
this.
|
|
12600
|
+
this.toHierarchyDirty();
|
|
12593
12601
|
DApplications.update(this);
|
|
12594
12602
|
}
|
|
12595
12603
|
if (!isAuto) {
|
|
12604
|
+
var scalarSet = this._scalarSet;
|
|
12596
12605
|
if (isNumber(width)) {
|
|
12597
|
-
|
|
12606
|
+
var oldWidth = this._width;
|
|
12607
|
+
if (oldWidth !== width) {
|
|
12608
|
+
scalarSet.width = undefined;
|
|
12609
|
+
this._width = width;
|
|
12610
|
+
var height = this._height;
|
|
12611
|
+
this.onResize(width, height, oldWidth, height);
|
|
12612
|
+
if (scalarSet.x != null) {
|
|
12613
|
+
var position = this._position;
|
|
12614
|
+
var parent_3 = this.getParentOfSize();
|
|
12615
|
+
if (parent_3) {
|
|
12616
|
+
position.x = scalarSet.x(parent_3.width, width, parent_3.padding.getLeft(), position.x);
|
|
12617
|
+
}
|
|
12618
|
+
}
|
|
12619
|
+
}
|
|
12620
|
+
else {
|
|
12621
|
+
if (scalarSet.width !== undefined) {
|
|
12622
|
+
scalarSet.width = undefined;
|
|
12623
|
+
this.toParentResized();
|
|
12624
|
+
}
|
|
12625
|
+
}
|
|
12598
12626
|
}
|
|
12599
12627
|
else {
|
|
12600
|
-
var scalarSet = this._scalarSet;
|
|
12601
12628
|
var scalar = DScalarFunctions.size(width);
|
|
12602
12629
|
if (scalarSet.width !== scalar) {
|
|
12603
12630
|
scalarSet.width = scalar;
|
|
@@ -12612,21 +12639,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12612
12639
|
return this._height;
|
|
12613
12640
|
},
|
|
12614
12641
|
set: function (height) {
|
|
12615
|
-
|
|
12616
|
-
if (oldHeight !== height) {
|
|
12617
|
-
this._height = height;
|
|
12618
|
-
var width = this._width;
|
|
12619
|
-
this.onResize(width, height, width, oldHeight);
|
|
12620
|
-
// Layout
|
|
12621
|
-
var scalarSet = this._scalarSet;
|
|
12622
|
-
if (scalarSet.y != null) {
|
|
12623
|
-
var position = this.transform.position;
|
|
12624
|
-
var parent_4 = this.getParentOfSize();
|
|
12625
|
-
if (parent_4) {
|
|
12626
|
-
this.y = scalarSet.y(parent_4.height, height, parent_4.padding.getTop(), position.y);
|
|
12627
|
-
}
|
|
12628
|
-
}
|
|
12629
|
-
}
|
|
12642
|
+
this.setHeight(height);
|
|
12630
12643
|
},
|
|
12631
12644
|
enumerable: false,
|
|
12632
12645
|
configurable: true
|
|
@@ -12639,15 +12652,34 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12639
12652
|
var isOn = auto.isOn;
|
|
12640
12653
|
var isAuto = auto.from(height);
|
|
12641
12654
|
if (auto.isOn !== isOn) {
|
|
12642
|
-
this.
|
|
12655
|
+
this.toHierarchyDirty();
|
|
12643
12656
|
DApplications.update(this);
|
|
12644
12657
|
}
|
|
12645
12658
|
if (!isAuto) {
|
|
12659
|
+
var scalarSet = this._scalarSet;
|
|
12646
12660
|
if (isNumber(height)) {
|
|
12647
|
-
|
|
12661
|
+
var oldHeight = this._height;
|
|
12662
|
+
if (oldHeight !== height) {
|
|
12663
|
+
scalarSet.height = undefined;
|
|
12664
|
+
this._height = height;
|
|
12665
|
+
var width = this._width;
|
|
12666
|
+
this.onResize(width, height, width, oldHeight);
|
|
12667
|
+
if (scalarSet.y != null) {
|
|
12668
|
+
var position = this._position;
|
|
12669
|
+
var parent_4 = this.getParentOfSize();
|
|
12670
|
+
if (parent_4) {
|
|
12671
|
+
position.y = scalarSet.y(parent_4.height, height, parent_4.padding.getTop(), position.y);
|
|
12672
|
+
}
|
|
12673
|
+
}
|
|
12674
|
+
}
|
|
12675
|
+
else {
|
|
12676
|
+
if (scalarSet.height !== undefined) {
|
|
12677
|
+
scalarSet.height = undefined;
|
|
12678
|
+
this.toParentResized();
|
|
12679
|
+
}
|
|
12680
|
+
}
|
|
12648
12681
|
}
|
|
12649
12682
|
else {
|
|
12650
|
-
var scalarSet = this._scalarSet;
|
|
12651
12683
|
var scalar = DScalarFunctions.size(height);
|
|
12652
12684
|
if (scalarSet.height !== scalar) {
|
|
12653
12685
|
scalarSet.height = scalar;
|
|
@@ -12746,7 +12778,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12746
12778
|
DBase.prototype.show = function () {
|
|
12747
12779
|
if (!this.visible) {
|
|
12748
12780
|
this.visible = true;
|
|
12749
|
-
this.
|
|
12781
|
+
this.toParentHierarchyDirty();
|
|
12750
12782
|
DApplications.update(this);
|
|
12751
12783
|
}
|
|
12752
12784
|
return this;
|
|
@@ -12757,7 +12789,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12757
12789
|
DBase.prototype.hide = function () {
|
|
12758
12790
|
if (this.visible) {
|
|
12759
12791
|
this.visible = false;
|
|
12760
|
-
this.
|
|
12792
|
+
this.toParentHierarchyDirty();
|
|
12761
12793
|
this.blur(true);
|
|
12762
12794
|
DApplications.update(this);
|
|
12763
12795
|
}
|
|
@@ -12788,25 +12820,25 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12788
12820
|
parent.toHasDirty();
|
|
12789
12821
|
}
|
|
12790
12822
|
};
|
|
12791
|
-
DBase.prototype.
|
|
12792
|
-
if (!this.
|
|
12793
|
-
this.
|
|
12794
|
-
this.
|
|
12795
|
-
this.
|
|
12823
|
+
DBase.prototype.toHierarchyDirty = function () {
|
|
12824
|
+
if (!this._isHierarchyDirty) {
|
|
12825
|
+
this._isHierarchyDirty = true;
|
|
12826
|
+
this.onHierarchyDirty();
|
|
12827
|
+
this.toParentHierarchyDirty();
|
|
12796
12828
|
return true;
|
|
12797
12829
|
}
|
|
12798
12830
|
return false;
|
|
12799
12831
|
};
|
|
12800
|
-
DBase.prototype.
|
|
12832
|
+
DBase.prototype.toParentHierarchyDirty = function () {
|
|
12801
12833
|
var parent = this.parent;
|
|
12802
12834
|
if (parent instanceof DBase) {
|
|
12803
|
-
parent.
|
|
12835
|
+
parent.toHierarchyDirty();
|
|
12804
12836
|
}
|
|
12805
12837
|
};
|
|
12806
|
-
DBase.prototype.
|
|
12807
|
-
return this.
|
|
12838
|
+
DBase.prototype.isHierarchyDirty = function () {
|
|
12839
|
+
return this._isHierarchyDirty;
|
|
12808
12840
|
};
|
|
12809
|
-
DBase.prototype.
|
|
12841
|
+
DBase.prototype.onHierarchyDirty = function () {
|
|
12810
12842
|
// DO NOTHING
|
|
12811
12843
|
};
|
|
12812
12844
|
DBase.prototype.isDirty = function () {
|
|
@@ -12922,16 +12954,26 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12922
12954
|
enumerable: false,
|
|
12923
12955
|
configurable: true
|
|
12924
12956
|
});
|
|
12925
|
-
DBase.prototype.
|
|
12926
|
-
|
|
12927
|
-
|
|
12957
|
+
DBase.prototype.reflow = function () {
|
|
12958
|
+
var isDirty = this._isDirty;
|
|
12959
|
+
if (isDirty) {
|
|
12960
|
+
this.onReflow();
|
|
12961
|
+
this._isDirty = false;
|
|
12962
|
+
}
|
|
12963
|
+
var hasDirty = this._hasDirty;
|
|
12964
|
+
var isHierarchyDirty = this._isHierarchyDirty;
|
|
12965
|
+
if (hasDirty || isHierarchyDirty) {
|
|
12966
|
+
this._hasDirty = false;
|
|
12967
|
+
this._isHierarchyDirty = false;
|
|
12928
12968
|
var children = this.children;
|
|
12929
12969
|
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
12930
12970
|
var child = children[i];
|
|
12931
12971
|
if (child instanceof DBase) {
|
|
12932
|
-
child.
|
|
12972
|
+
child.reflow();
|
|
12933
12973
|
}
|
|
12934
12974
|
}
|
|
12975
|
+
}
|
|
12976
|
+
if (isDirty || hasDirty || isHierarchyDirty) {
|
|
12935
12977
|
this.onRefit();
|
|
12936
12978
|
}
|
|
12937
12979
|
};
|
|
@@ -12966,7 +13008,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12966
13008
|
width = Math.max(width, child.x + child.width);
|
|
12967
13009
|
}
|
|
12968
13010
|
}
|
|
12969
|
-
this.width
|
|
13011
|
+
this.resize(width + this.padding.getRight(), undefined);
|
|
12970
13012
|
}
|
|
12971
13013
|
else if (isHeightAuto) {
|
|
12972
13014
|
var height = 0;
|
|
@@ -12977,7 +13019,7 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12977
13019
|
height = Math.max(height, child.y + child.height);
|
|
12978
13020
|
}
|
|
12979
13021
|
}
|
|
12980
|
-
this.
|
|
13022
|
+
this.resize(undefined, height + this.padding.getBottom());
|
|
12981
13023
|
}
|
|
12982
13024
|
};
|
|
12983
13025
|
DBase.prototype.isRefitable = function (target) {
|
|
@@ -12989,22 +13031,6 @@ var DBase = /** @class */ (function (_super) {
|
|
|
12989
13031
|
DBase.prototype.hasRefitableWidth = function (target) {
|
|
12990
13032
|
return (this.isRefitable(target) && !(target instanceof DBase && isFunction(target.getWidth())));
|
|
12991
13033
|
};
|
|
12992
|
-
DBase.prototype.reflow = function () {
|
|
12993
|
-
if (this._isDirty) {
|
|
12994
|
-
this.onReflow();
|
|
12995
|
-
this._isDirty = false;
|
|
12996
|
-
}
|
|
12997
|
-
if (this._hasDirty) {
|
|
12998
|
-
var children = this.children;
|
|
12999
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
13000
|
-
var child = children[i];
|
|
13001
|
-
if (child instanceof DBase) {
|
|
13002
|
-
child.reflow();
|
|
13003
|
-
}
|
|
13004
|
-
}
|
|
13005
|
-
this._hasDirty = false;
|
|
13006
|
-
}
|
|
13007
|
-
};
|
|
13008
13034
|
DBase.prototype.onReflow = function () {
|
|
13009
13035
|
this._reflowable.onReflow(this, this._width, this._height);
|
|
13010
13036
|
};
|
|
@@ -18308,36 +18334,6 @@ var DButtonBaseWhen = {
|
|
|
18308
18334
|
DOUBLE_CLICKED: 1
|
|
18309
18335
|
};
|
|
18310
18336
|
|
|
18311
|
-
/*
|
|
18312
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
18313
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
18314
|
-
*/
|
|
18315
|
-
var DAlignHorizontal = {
|
|
18316
|
-
LEFT: 0,
|
|
18317
|
-
CENTER: 1,
|
|
18318
|
-
RIGHT: 2
|
|
18319
|
-
};
|
|
18320
|
-
|
|
18321
|
-
/*
|
|
18322
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
18323
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
18324
|
-
*/
|
|
18325
|
-
var DAlignVertical = {
|
|
18326
|
-
TOP: 0,
|
|
18327
|
-
MIDDLE: 1,
|
|
18328
|
-
BOTTOM: 2
|
|
18329
|
-
};
|
|
18330
|
-
|
|
18331
|
-
/*
|
|
18332
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
18333
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
18334
|
-
*/
|
|
18335
|
-
var DAlignWith = {
|
|
18336
|
-
TEXT: 0,
|
|
18337
|
-
PADDING: 1,
|
|
18338
|
-
BORDER: 2
|
|
18339
|
-
};
|
|
18340
|
-
|
|
18341
18337
|
var DImageBaseThemeWrapperSecondary = /** @class */ (function () {
|
|
18342
18338
|
function DImageBaseThemeWrapperSecondary(theme) {
|
|
18343
18339
|
this._theme = theme;
|
|
@@ -18400,6 +18396,36 @@ var DImageBaseThemeWrapperTertiary = /** @class */ (function () {
|
|
|
18400
18396
|
return DImageBaseThemeWrapperTertiary;
|
|
18401
18397
|
}());
|
|
18402
18398
|
|
|
18399
|
+
/*
|
|
18400
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
18401
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18402
|
+
*/
|
|
18403
|
+
var DAlignHorizontal = {
|
|
18404
|
+
LEFT: 0,
|
|
18405
|
+
CENTER: 1,
|
|
18406
|
+
RIGHT: 2
|
|
18407
|
+
};
|
|
18408
|
+
|
|
18409
|
+
/*
|
|
18410
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
18411
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18412
|
+
*/
|
|
18413
|
+
var DAlignVertical = {
|
|
18414
|
+
TOP: 0,
|
|
18415
|
+
MIDDLE: 1,
|
|
18416
|
+
BOTTOM: 2
|
|
18417
|
+
};
|
|
18418
|
+
|
|
18419
|
+
/*
|
|
18420
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
18421
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
18422
|
+
*/
|
|
18423
|
+
var DAlignWith = {
|
|
18424
|
+
TEXT: 0,
|
|
18425
|
+
PADDING: 1,
|
|
18426
|
+
BORDER: 2
|
|
18427
|
+
};
|
|
18428
|
+
|
|
18403
18429
|
var toImageAlign = function (theme, options) {
|
|
18404
18430
|
var _a, _b, _c;
|
|
18405
18431
|
var align = options === null || options === void 0 ? void 0 : options.align;
|
|
@@ -18680,6 +18706,388 @@ var DImagePiece = /** @class */ (function () {
|
|
|
18680
18706
|
return DImagePiece;
|
|
18681
18707
|
}());
|
|
18682
18708
|
|
|
18709
|
+
var DImagePieceLayouterPart = /** @class */ (function () {
|
|
18710
|
+
function DImagePieceLayouterPart() {
|
|
18711
|
+
this.pieces = [];
|
|
18712
|
+
this.size = 0;
|
|
18713
|
+
}
|
|
18714
|
+
DImagePieceLayouterPart.prototype.clear = function () {
|
|
18715
|
+
this.pieces.length = 0;
|
|
18716
|
+
this.size = 0;
|
|
18717
|
+
};
|
|
18718
|
+
DImagePieceLayouterPart.prototype.add = function (image, size, margin) {
|
|
18719
|
+
var pieces = this.pieces;
|
|
18720
|
+
pieces.push(image);
|
|
18721
|
+
this.size += margin + size;
|
|
18722
|
+
};
|
|
18723
|
+
return DImagePieceLayouterPart;
|
|
18724
|
+
}());
|
|
18725
|
+
|
|
18726
|
+
var DImagePieceLayouterPartBottom = /** @class */ (function (_super) {
|
|
18727
|
+
__extends(DImagePieceLayouterPartBottom, _super);
|
|
18728
|
+
function DImagePieceLayouterPartBottom() {
|
|
18729
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18730
|
+
}
|
|
18731
|
+
DImagePieceLayouterPartBottom.prototype.execute = function (pbottom, height, marginAfter) {
|
|
18732
|
+
var pieces = this.pieces;
|
|
18733
|
+
var y = height - pbottom;
|
|
18734
|
+
if (marginAfter) {
|
|
18735
|
+
var margin = 0;
|
|
18736
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18737
|
+
var piece = pieces[i];
|
|
18738
|
+
y -= margin + piece.bound.height;
|
|
18739
|
+
piece.image.y = y;
|
|
18740
|
+
margin = piece.margin.horizontal;
|
|
18741
|
+
}
|
|
18742
|
+
}
|
|
18743
|
+
else {
|
|
18744
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18745
|
+
var piece = pieces[i];
|
|
18746
|
+
y -= piece.margin.horizontal + piece.bound.height;
|
|
18747
|
+
piece.image.y = y;
|
|
18748
|
+
}
|
|
18749
|
+
}
|
|
18750
|
+
};
|
|
18751
|
+
return DImagePieceLayouterPartBottom;
|
|
18752
|
+
}(DImagePieceLayouterPart));
|
|
18753
|
+
|
|
18754
|
+
var DImagePieceLayouterPartCenter = /** @class */ (function (_super) {
|
|
18755
|
+
__extends(DImagePieceLayouterPartCenter, _super);
|
|
18756
|
+
function DImagePieceLayouterPartCenter() {
|
|
18757
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18758
|
+
}
|
|
18759
|
+
DImagePieceLayouterPartCenter.prototype.add = function (image, size, margin) {
|
|
18760
|
+
var pieces = this.pieces;
|
|
18761
|
+
pieces.push(image);
|
|
18762
|
+
this.size = Math.max(this.size, size);
|
|
18763
|
+
};
|
|
18764
|
+
DImagePieceLayouterPartCenter.prototype.execute = function (pleft, pright, width) {
|
|
18765
|
+
var c = pleft + (width - pleft - pright) * 0.5;
|
|
18766
|
+
var pieces = this.pieces;
|
|
18767
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18768
|
+
var piece = pieces[i];
|
|
18769
|
+
piece.image.x = c - piece.bound.width * 0.5;
|
|
18770
|
+
}
|
|
18771
|
+
};
|
|
18772
|
+
return DImagePieceLayouterPartCenter;
|
|
18773
|
+
}(DImagePieceLayouterPart));
|
|
18774
|
+
|
|
18775
|
+
var DImagePieceLayouterPartLeft = /** @class */ (function (_super) {
|
|
18776
|
+
__extends(DImagePieceLayouterPartLeft, _super);
|
|
18777
|
+
function DImagePieceLayouterPartLeft() {
|
|
18778
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18779
|
+
}
|
|
18780
|
+
DImagePieceLayouterPartLeft.prototype.execute = function (pleft, marginAfter) {
|
|
18781
|
+
var pieces = this.pieces;
|
|
18782
|
+
var x = pleft;
|
|
18783
|
+
if (marginAfter) {
|
|
18784
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18785
|
+
var piece = pieces[i];
|
|
18786
|
+
piece.image.x = x;
|
|
18787
|
+
x += piece.bound.width + piece.margin.horizontal;
|
|
18788
|
+
}
|
|
18789
|
+
}
|
|
18790
|
+
else {
|
|
18791
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18792
|
+
var piece = pieces[i];
|
|
18793
|
+
x += piece.margin.horizontal;
|
|
18794
|
+
piece.image.x = x;
|
|
18795
|
+
x += piece.bound.width;
|
|
18796
|
+
}
|
|
18797
|
+
}
|
|
18798
|
+
};
|
|
18799
|
+
return DImagePieceLayouterPartLeft;
|
|
18800
|
+
}(DImagePieceLayouterPart));
|
|
18801
|
+
|
|
18802
|
+
var DImagePieceLayouterPartMiddle = /** @class */ (function (_super) {
|
|
18803
|
+
__extends(DImagePieceLayouterPartMiddle, _super);
|
|
18804
|
+
function DImagePieceLayouterPartMiddle() {
|
|
18805
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18806
|
+
}
|
|
18807
|
+
DImagePieceLayouterPartMiddle.prototype.add = function (image, size, margin) {
|
|
18808
|
+
var pieces = this.pieces;
|
|
18809
|
+
pieces.push(image);
|
|
18810
|
+
this.size = Math.max(this.size, size);
|
|
18811
|
+
};
|
|
18812
|
+
DImagePieceLayouterPartMiddle.prototype.execute = function (ptop, pbottom, height) {
|
|
18813
|
+
var c = ptop + (height - ptop - pbottom) * 0.5;
|
|
18814
|
+
var pieces = this.pieces;
|
|
18815
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18816
|
+
var piece = pieces[i];
|
|
18817
|
+
piece.image.y = c - piece.bound.height * 0.5;
|
|
18818
|
+
}
|
|
18819
|
+
};
|
|
18820
|
+
return DImagePieceLayouterPartMiddle;
|
|
18821
|
+
}(DImagePieceLayouterPart));
|
|
18822
|
+
|
|
18823
|
+
var DImagePieceLayouterPartRight = /** @class */ (function (_super) {
|
|
18824
|
+
__extends(DImagePieceLayouterPartRight, _super);
|
|
18825
|
+
function DImagePieceLayouterPartRight() {
|
|
18826
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18827
|
+
}
|
|
18828
|
+
DImagePieceLayouterPartRight.prototype.execute = function (pright, width, marginAfter) {
|
|
18829
|
+
var pieces = this.pieces;
|
|
18830
|
+
var x = width - pright;
|
|
18831
|
+
if (marginAfter) {
|
|
18832
|
+
var margin = 0;
|
|
18833
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18834
|
+
var piece = pieces[i];
|
|
18835
|
+
x -= margin + piece.bound.width;
|
|
18836
|
+
piece.image.x = x;
|
|
18837
|
+
margin = piece.margin.horizontal;
|
|
18838
|
+
}
|
|
18839
|
+
}
|
|
18840
|
+
else {
|
|
18841
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18842
|
+
var piece = pieces[i];
|
|
18843
|
+
x -= piece.margin.horizontal + piece.bound.width;
|
|
18844
|
+
piece.image.x = x;
|
|
18845
|
+
}
|
|
18846
|
+
}
|
|
18847
|
+
};
|
|
18848
|
+
return DImagePieceLayouterPartRight;
|
|
18849
|
+
}(DImagePieceLayouterPart));
|
|
18850
|
+
|
|
18851
|
+
var DImagePieceLayouterPartTop = /** @class */ (function (_super) {
|
|
18852
|
+
__extends(DImagePieceLayouterPartTop, _super);
|
|
18853
|
+
function DImagePieceLayouterPartTop() {
|
|
18854
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
18855
|
+
}
|
|
18856
|
+
DImagePieceLayouterPartTop.prototype.execute = function (ptop, marginAfter) {
|
|
18857
|
+
var pieces = this.pieces;
|
|
18858
|
+
var y = ptop;
|
|
18859
|
+
if (marginAfter) {
|
|
18860
|
+
var margin = 0;
|
|
18861
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18862
|
+
var piece = pieces[i];
|
|
18863
|
+
piece.image.y = margin + y;
|
|
18864
|
+
y += piece.bound.height;
|
|
18865
|
+
margin = piece.margin.vertical;
|
|
18866
|
+
}
|
|
18867
|
+
}
|
|
18868
|
+
else {
|
|
18869
|
+
for (var i = 0, imax = pieces.length; i < imax; ++i) {
|
|
18870
|
+
var piece = pieces[i];
|
|
18871
|
+
y += piece.margin.vertical;
|
|
18872
|
+
piece.image.y = y;
|
|
18873
|
+
y += piece.bound.height;
|
|
18874
|
+
}
|
|
18875
|
+
}
|
|
18876
|
+
};
|
|
18877
|
+
return DImagePieceLayouterPartTop;
|
|
18878
|
+
}(DImagePieceLayouterPart));
|
|
18879
|
+
|
|
18880
|
+
var DImagePieceLayouterPartContainer = /** @class */ (function () {
|
|
18881
|
+
function DImagePieceLayouterPartContainer() {
|
|
18882
|
+
this.left = new DImagePieceLayouterPartLeft();
|
|
18883
|
+
this.center = new DImagePieceLayouterPartCenter();
|
|
18884
|
+
this.right = new DImagePieceLayouterPartRight();
|
|
18885
|
+
this.top = new DImagePieceLayouterPartTop();
|
|
18886
|
+
this.middle = new DImagePieceLayouterPartMiddle();
|
|
18887
|
+
this.bottom = new DImagePieceLayouterPartBottom();
|
|
18888
|
+
}
|
|
18889
|
+
DImagePieceLayouterPartContainer.prototype.clear = function () {
|
|
18890
|
+
this.left.clear();
|
|
18891
|
+
this.center.clear();
|
|
18892
|
+
this.right.clear();
|
|
18893
|
+
this.top.clear();
|
|
18894
|
+
this.middle.clear();
|
|
18895
|
+
this.bottom.clear();
|
|
18896
|
+
this.text = undefined;
|
|
18897
|
+
};
|
|
18898
|
+
DImagePieceLayouterPartContainer.prototype.add = function (image) {
|
|
18899
|
+
var imageImage = image.image;
|
|
18900
|
+
if (imageImage != null) {
|
|
18901
|
+
var imageBound = image.bound;
|
|
18902
|
+
var imageBoundWidth = imageBound.width;
|
|
18903
|
+
var imageBoundHeight = imageBound.height;
|
|
18904
|
+
var imageMargin = image.margin;
|
|
18905
|
+
var imageMarginHorizontal = imageMargin.horizontal;
|
|
18906
|
+
var imageMarginVertical = imageMargin.vertical;
|
|
18907
|
+
var imageAlign = image.align;
|
|
18908
|
+
switch (imageAlign.horizontal) {
|
|
18909
|
+
case DAlignHorizontal.LEFT:
|
|
18910
|
+
this.left.add(image, imageBoundWidth, imageMarginHorizontal);
|
|
18911
|
+
break;
|
|
18912
|
+
case DAlignHorizontal.CENTER:
|
|
18913
|
+
this.center.add(image, imageBoundWidth, imageMarginHorizontal);
|
|
18914
|
+
break;
|
|
18915
|
+
case DAlignHorizontal.RIGHT:
|
|
18916
|
+
this.right.add(image, imageBoundWidth, imageMarginHorizontal);
|
|
18917
|
+
break;
|
|
18918
|
+
}
|
|
18919
|
+
switch (imageAlign.vertical) {
|
|
18920
|
+
case DAlignVertical.TOP:
|
|
18921
|
+
this.top.add(image, imageBoundHeight, imageMarginVertical);
|
|
18922
|
+
break;
|
|
18923
|
+
case DAlignVertical.MIDDLE:
|
|
18924
|
+
this.middle.add(image, imageBoundHeight, imageMarginVertical);
|
|
18925
|
+
break;
|
|
18926
|
+
case DAlignVertical.BOTTOM:
|
|
18927
|
+
this.bottom.add(image, imageBoundHeight, imageMarginVertical);
|
|
18928
|
+
break;
|
|
18929
|
+
}
|
|
18930
|
+
}
|
|
18931
|
+
};
|
|
18932
|
+
DImagePieceLayouterPartContainer.prototype.set = function (text) {
|
|
18933
|
+
this.text = text;
|
|
18934
|
+
};
|
|
18935
|
+
Object.defineProperty(DImagePieceLayouterPartContainer.prototype, "width", {
|
|
18936
|
+
get: function () {
|
|
18937
|
+
var text = this.text;
|
|
18938
|
+
var left = this.left;
|
|
18939
|
+
var center = this.center;
|
|
18940
|
+
var right = this.right;
|
|
18941
|
+
if (text) {
|
|
18942
|
+
return Math.max(left.size + text.width + right.size, center.size);
|
|
18943
|
+
}
|
|
18944
|
+
else {
|
|
18945
|
+
return Math.max(left.size, right.size, center.size);
|
|
18946
|
+
}
|
|
18947
|
+
},
|
|
18948
|
+
enumerable: false,
|
|
18949
|
+
configurable: true
|
|
18950
|
+
});
|
|
18951
|
+
Object.defineProperty(DImagePieceLayouterPartContainer.prototype, "height", {
|
|
18952
|
+
get: function () {
|
|
18953
|
+
var text = this.text;
|
|
18954
|
+
var top = this.top;
|
|
18955
|
+
var middle = this.middle;
|
|
18956
|
+
var bottom = this.bottom;
|
|
18957
|
+
if (text) {
|
|
18958
|
+
return Math.max(top.size + text.height + bottom.size, middle.size);
|
|
18959
|
+
}
|
|
18960
|
+
else {
|
|
18961
|
+
return Math.max(top.size, bottom.size, middle.size);
|
|
18962
|
+
}
|
|
18963
|
+
},
|
|
18964
|
+
enumerable: false,
|
|
18965
|
+
configurable: true
|
|
18966
|
+
});
|
|
18967
|
+
DImagePieceLayouterPartContainer.prototype.execute = function (pleft, ptop, pright, pbottom, textAlign, width, height) {
|
|
18968
|
+
var left = this.left;
|
|
18969
|
+
var center = this.center;
|
|
18970
|
+
var right = this.right;
|
|
18971
|
+
var top = this.top;
|
|
18972
|
+
var middle = this.middle;
|
|
18973
|
+
var bottom = this.bottom;
|
|
18974
|
+
var text = this.text;
|
|
18975
|
+
if (text) {
|
|
18976
|
+
var textX = 0;
|
|
18977
|
+
var textWidth = text.width;
|
|
18978
|
+
switch (textAlign.horizontal) {
|
|
18979
|
+
case DAlignHorizontal.LEFT:
|
|
18980
|
+
textX = pleft + left.size;
|
|
18981
|
+
break;
|
|
18982
|
+
case DAlignHorizontal.CENTER:
|
|
18983
|
+
textX =
|
|
18984
|
+
pleft +
|
|
18985
|
+
(width - pleft - pright - (left.size + textWidth + right.size)) * 0.5 +
|
|
18986
|
+
left.size;
|
|
18987
|
+
break;
|
|
18988
|
+
case DAlignHorizontal.RIGHT:
|
|
18989
|
+
textX = width - pright - right.size - textWidth;
|
|
18990
|
+
break;
|
|
18991
|
+
}
|
|
18992
|
+
var textY = 0;
|
|
18993
|
+
var textHeight = text.height;
|
|
18994
|
+
switch (textAlign.vertical) {
|
|
18995
|
+
case DAlignVertical.TOP:
|
|
18996
|
+
textY = ptop + top.size;
|
|
18997
|
+
break;
|
|
18998
|
+
case DAlignVertical.MIDDLE:
|
|
18999
|
+
textY =
|
|
19000
|
+
ptop +
|
|
19001
|
+
(height - ptop - pbottom - (top.size + textHeight + bottom.size)) * 0.5 +
|
|
19002
|
+
top.size;
|
|
19003
|
+
break;
|
|
19004
|
+
case DAlignVertical.BOTTOM:
|
|
19005
|
+
textY = height - pbottom - bottom.size - textHeight;
|
|
19006
|
+
break;
|
|
19007
|
+
}
|
|
19008
|
+
text.position.set(textX, textY);
|
|
19009
|
+
text.setClippingDelta(left.size + right.size, top.size + bottom.size);
|
|
19010
|
+
left.execute(textX - left.size, true);
|
|
19011
|
+
center.execute(0, 0, textX * 2 + textWidth);
|
|
19012
|
+
right.execute(0, textX + textWidth + right.size, true);
|
|
19013
|
+
top.execute(textY - top.size, true);
|
|
19014
|
+
middle.execute(0, 0, textY * 2 + textHeight);
|
|
19015
|
+
bottom.execute(0, textY + textHeight + bottom.size, true);
|
|
19016
|
+
}
|
|
19017
|
+
else {
|
|
19018
|
+
left.execute(pleft, false);
|
|
19019
|
+
center.execute(pleft, pright, width);
|
|
19020
|
+
right.execute(pright, width, false);
|
|
19021
|
+
top.execute(ptop, false);
|
|
19022
|
+
middle.execute(ptop, pbottom, height);
|
|
19023
|
+
bottom.execute(pbottom, height, false);
|
|
19024
|
+
}
|
|
19025
|
+
};
|
|
19026
|
+
return DImagePieceLayouterPartContainer;
|
|
19027
|
+
}());
|
|
19028
|
+
|
|
19029
|
+
var DImagePieceLayouter = /** @class */ (function () {
|
|
19030
|
+
function DImagePieceLayouter() {
|
|
19031
|
+
this.text = new DImagePieceLayouterPartContainer();
|
|
19032
|
+
this.padding = new DImagePieceLayouterPartContainer();
|
|
19033
|
+
this.border = new DImagePieceLayouterPartContainer();
|
|
19034
|
+
}
|
|
19035
|
+
DImagePieceLayouter.prototype.clear = function () {
|
|
19036
|
+
this.text.clear();
|
|
19037
|
+
this.padding.clear();
|
|
19038
|
+
this.border.clear();
|
|
19039
|
+
};
|
|
19040
|
+
DImagePieceLayouter.prototype.add = function (image) {
|
|
19041
|
+
var imageImage = image.image;
|
|
19042
|
+
if (imageImage) {
|
|
19043
|
+
switch (image.align.with) {
|
|
19044
|
+
case DAlignWith.TEXT:
|
|
19045
|
+
this.text.add(image);
|
|
19046
|
+
break;
|
|
19047
|
+
case DAlignWith.PADDING:
|
|
19048
|
+
this.padding.add(image);
|
|
19049
|
+
break;
|
|
19050
|
+
case DAlignWith.BORDER:
|
|
19051
|
+
this.border.add(image);
|
|
19052
|
+
break;
|
|
19053
|
+
}
|
|
19054
|
+
}
|
|
19055
|
+
};
|
|
19056
|
+
DImagePieceLayouter.prototype.set = function (text) {
|
|
19057
|
+
this.text.set(text);
|
|
19058
|
+
};
|
|
19059
|
+
DImagePieceLayouter.prototype.execute = function (padding, textAlign, width, height) {
|
|
19060
|
+
var pleft = padding.getLeft();
|
|
19061
|
+
var ptop = padding.getTop();
|
|
19062
|
+
var pright = padding.getRight();
|
|
19063
|
+
var pbottom = padding.getBottom();
|
|
19064
|
+
if (width == null) {
|
|
19065
|
+
width = pleft + this.width + pright;
|
|
19066
|
+
}
|
|
19067
|
+
if (height == null) {
|
|
19068
|
+
height = ptop + this.height + pbottom;
|
|
19069
|
+
}
|
|
19070
|
+
this.border.execute(0, 0, 0, 0, textAlign, width, height);
|
|
19071
|
+
this.padding.execute(pleft, ptop, pright, pbottom, textAlign, width, height);
|
|
19072
|
+
this.text.execute(pleft, ptop, pright, pbottom, textAlign, width, height);
|
|
19073
|
+
};
|
|
19074
|
+
Object.defineProperty(DImagePieceLayouter.prototype, "width", {
|
|
19075
|
+
get: function () {
|
|
19076
|
+
return Math.max(this.border.width, this.padding.width, this.text.width);
|
|
19077
|
+
},
|
|
19078
|
+
enumerable: false,
|
|
19079
|
+
configurable: true
|
|
19080
|
+
});
|
|
19081
|
+
Object.defineProperty(DImagePieceLayouter.prototype, "height", {
|
|
19082
|
+
get: function () {
|
|
19083
|
+
return Math.max(this.border.height, this.padding.height, this.text.height);
|
|
19084
|
+
},
|
|
19085
|
+
enumerable: false,
|
|
19086
|
+
configurable: true
|
|
19087
|
+
});
|
|
19088
|
+
return DImagePieceLayouter;
|
|
19089
|
+
}());
|
|
19090
|
+
|
|
18683
19091
|
/*
|
|
18684
19092
|
* Copyright (C) 2019 Toshiba Corporation
|
|
18685
19093
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -19905,32 +20313,42 @@ var DTextBase = /** @class */ (function (_super) {
|
|
|
19905
20313
|
DTextBase.prototype.updateTextPosition = function (text) {
|
|
19906
20314
|
var align = this._textAlign;
|
|
19907
20315
|
var padding = this._padding;
|
|
19908
|
-
var
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19912
|
-
|
|
19913
|
-
|
|
19914
|
-
text.x = toRounded((this.width - text.width) * 0.5);
|
|
19915
|
-
break;
|
|
19916
|
-
case DAlignHorizontal.RIGHT:
|
|
19917
|
-
text.x = toRounded(this.width - text.width - padding.getRight());
|
|
19918
|
-
break;
|
|
20316
|
+
var auto = this._auto;
|
|
20317
|
+
var textX = 0;
|
|
20318
|
+
var pleft = padding.getLeft();
|
|
20319
|
+
var alignHorizontal = align.horizontal;
|
|
20320
|
+
if (auto.width.isOn || alignHorizontal === DAlignHorizontal.LEFT) {
|
|
20321
|
+
textX = pleft;
|
|
19919
20322
|
}
|
|
19920
|
-
|
|
19921
|
-
|
|
19922
|
-
|
|
19923
|
-
|
|
19924
|
-
|
|
19925
|
-
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
20323
|
+
else {
|
|
20324
|
+
var width = this.width;
|
|
20325
|
+
var textWidth = text.width;
|
|
20326
|
+
var pright = padding.getRight();
|
|
20327
|
+
if (alignHorizontal === DAlignHorizontal.CENTER) {
|
|
20328
|
+
textX = pleft + (width - pleft - pright - textWidth) * 0.5;
|
|
20329
|
+
}
|
|
20330
|
+
else {
|
|
20331
|
+
textX = width - textWidth - pright;
|
|
20332
|
+
}
|
|
19930
20333
|
}
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
20334
|
+
var textY = 0;
|
|
20335
|
+
var ptop = padding.getTop();
|
|
20336
|
+
var alignVertical = align.vertical;
|
|
20337
|
+
if (auto.height.isOn || alignVertical === DAlignVertical.TOP) {
|
|
20338
|
+
textY = ptop;
|
|
20339
|
+
}
|
|
20340
|
+
else {
|
|
20341
|
+
var height = this.height;
|
|
20342
|
+
var textHeight = text.height;
|
|
20343
|
+
var pbottom = padding.getBottom();
|
|
20344
|
+
if (alignVertical === DAlignVertical.MIDDLE) {
|
|
20345
|
+
textY = ptop + (height - ptop - pbottom - textHeight) * 0.5;
|
|
20346
|
+
}
|
|
20347
|
+
else {
|
|
20348
|
+
textY = height - textHeight - pbottom;
|
|
20349
|
+
}
|
|
20350
|
+
}
|
|
20351
|
+
text.position.set(textX, textY);
|
|
19934
20352
|
};
|
|
19935
20353
|
DTextBase.prototype.getTextColor = function (theme, state) {
|
|
19936
20354
|
var color = this._textColor;
|
|
@@ -20100,277 +20518,24 @@ var DImageBase = /** @class */ (function (_super) {
|
|
|
20100
20518
|
this.updateTextAndImage();
|
|
20101
20519
|
};
|
|
20102
20520
|
DImageBase.prototype.updateTextAndImage = function () {
|
|
20103
|
-
var
|
|
20521
|
+
var _a;
|
|
20104
20522
|
var images = this._images;
|
|
20105
|
-
var
|
|
20106
|
-
var toRounded = this.toRounded;
|
|
20107
|
-
var width = this.width;
|
|
20108
|
-
var height = this.height;
|
|
20109
|
-
var pl = padding.getLeft();
|
|
20110
|
-
var pr = padding.getRight();
|
|
20111
|
-
var pt = padding.getTop();
|
|
20112
|
-
var pb = padding.getBottom();
|
|
20113
|
-
var noText = text == null;
|
|
20114
|
-
var textLeftFirst = noText;
|
|
20115
|
-
var textTopFirst = noText;
|
|
20116
|
-
var textRightLastMargin = 0;
|
|
20117
|
-
var textBottomLastMargin = 0;
|
|
20118
|
-
var textLeft = 0;
|
|
20119
|
-
var textRight = 0;
|
|
20120
|
-
var textTop = 0;
|
|
20121
|
-
var textBottom = 0;
|
|
20122
|
-
var paddingLeft = pl;
|
|
20123
|
-
var paddingRight = width - pr;
|
|
20124
|
-
var paddingTop = pt;
|
|
20125
|
-
var paddingBottom = height - pb;
|
|
20126
|
-
var borderLeft = 0;
|
|
20127
|
-
var borderRight = width;
|
|
20128
|
-
var borderTop = 0;
|
|
20129
|
-
var borderBottom = height;
|
|
20523
|
+
var layouter = ((_a = DImageBase.LAYOUTER) !== null && _a !== void 0 ? _a : (DImageBase.LAYOUTER = new DImagePieceLayouter()));
|
|
20130
20524
|
for (var i = 0, imax = images.length; i < imax; ++i) {
|
|
20131
20525
|
var image = images[i];
|
|
20132
20526
|
image.updateSource();
|
|
20133
20527
|
image.updateTint();
|
|
20134
20528
|
image.updateBound();
|
|
20135
|
-
|
|
20136
|
-
if (imageImage) {
|
|
20137
|
-
var imageBound = image.bound;
|
|
20138
|
-
var imageBoundWidth = imageBound.width;
|
|
20139
|
-
var imageBoundHeight = imageBound.height;
|
|
20140
|
-
var imageMargin = image.margin;
|
|
20141
|
-
var imageMarginHorizontal = imageMargin.horizontal;
|
|
20142
|
-
var imageMarginVertical = imageMargin.vertical;
|
|
20143
|
-
// Text
|
|
20144
|
-
if (image.align.with === DAlignWith.TEXT) {
|
|
20145
|
-
switch (image.align.horizontal) {
|
|
20146
|
-
case DAlignHorizontal.LEFT:
|
|
20147
|
-
imageImage.x = textLeft;
|
|
20148
|
-
textLeft += imageBoundWidth;
|
|
20149
|
-
if (textLeftFirst) {
|
|
20150
|
-
textLeftFirst = false;
|
|
20151
|
-
}
|
|
20152
|
-
else {
|
|
20153
|
-
textLeft += imageMarginHorizontal;
|
|
20154
|
-
}
|
|
20155
|
-
break;
|
|
20156
|
-
case DAlignHorizontal.CENTER:
|
|
20157
|
-
// DO NOTHING
|
|
20158
|
-
break;
|
|
20159
|
-
case DAlignHorizontal.RIGHT:
|
|
20160
|
-
textRight -= imageBoundWidth;
|
|
20161
|
-
imageImage.x = textRight;
|
|
20162
|
-
textRight -= imageMarginHorizontal;
|
|
20163
|
-
textRightLastMargin = imageMarginHorizontal;
|
|
20164
|
-
break;
|
|
20165
|
-
}
|
|
20166
|
-
switch (image.align.vertical) {
|
|
20167
|
-
case DAlignVertical.TOP:
|
|
20168
|
-
imageImage.y = textTop;
|
|
20169
|
-
textTop += imageBoundHeight;
|
|
20170
|
-
if (textTopFirst) {
|
|
20171
|
-
textTopFirst = false;
|
|
20172
|
-
}
|
|
20173
|
-
else {
|
|
20174
|
-
textTop += imageMarginVertical;
|
|
20175
|
-
}
|
|
20176
|
-
break;
|
|
20177
|
-
case DAlignVertical.MIDDLE:
|
|
20178
|
-
// DO NOTHING
|
|
20179
|
-
break;
|
|
20180
|
-
case DAlignVertical.BOTTOM:
|
|
20181
|
-
textBottom -= imageBoundHeight;
|
|
20182
|
-
imageImage.y = textBottom;
|
|
20183
|
-
textBottom -= imageMarginVertical;
|
|
20184
|
-
textBottomLastMargin = imageMarginVertical;
|
|
20185
|
-
break;
|
|
20186
|
-
}
|
|
20187
|
-
}
|
|
20188
|
-
// Padding
|
|
20189
|
-
if (image.align.with === DAlignWith.PADDING) {
|
|
20190
|
-
switch (image.align.horizontal) {
|
|
20191
|
-
case DAlignHorizontal.LEFT:
|
|
20192
|
-
paddingLeft += imageMarginHorizontal;
|
|
20193
|
-
imageImage.x = toRounded(paddingLeft);
|
|
20194
|
-
paddingLeft += imageBoundWidth;
|
|
20195
|
-
break;
|
|
20196
|
-
case DAlignHorizontal.CENTER:
|
|
20197
|
-
// DO NOTHING
|
|
20198
|
-
break;
|
|
20199
|
-
case DAlignHorizontal.RIGHT:
|
|
20200
|
-
paddingRight -= imageBoundWidth + imageMarginHorizontal;
|
|
20201
|
-
imageImage.x = toRounded(paddingRight);
|
|
20202
|
-
break;
|
|
20203
|
-
}
|
|
20204
|
-
switch (image.align.vertical) {
|
|
20205
|
-
case DAlignVertical.TOP:
|
|
20206
|
-
paddingTop += imageMarginVertical;
|
|
20207
|
-
imageImage.y = toRounded(paddingTop);
|
|
20208
|
-
paddingTop += imageBoundHeight;
|
|
20209
|
-
break;
|
|
20210
|
-
case DAlignVertical.MIDDLE:
|
|
20211
|
-
// DO NOTHING
|
|
20212
|
-
break;
|
|
20213
|
-
case DAlignVertical.BOTTOM:
|
|
20214
|
-
paddingBottom -= imageBoundHeight + imageMarginVertical;
|
|
20215
|
-
imageImage.y = toRounded(paddingBottom);
|
|
20216
|
-
break;
|
|
20217
|
-
}
|
|
20218
|
-
}
|
|
20219
|
-
// Border
|
|
20220
|
-
if (image.align.with === DAlignWith.BORDER) {
|
|
20221
|
-
switch (image.align.horizontal) {
|
|
20222
|
-
case DAlignHorizontal.LEFT:
|
|
20223
|
-
borderLeft += imageMarginHorizontal;
|
|
20224
|
-
imageImage.x = toRounded(borderLeft);
|
|
20225
|
-
borderLeft += imageBoundWidth;
|
|
20226
|
-
break;
|
|
20227
|
-
case DAlignHorizontal.CENTER:
|
|
20228
|
-
// DO NOTHING
|
|
20229
|
-
break;
|
|
20230
|
-
case DAlignHorizontal.RIGHT:
|
|
20231
|
-
borderRight -= imageBoundWidth + imageMarginHorizontal;
|
|
20232
|
-
imageImage.x = toRounded(borderRight);
|
|
20233
|
-
break;
|
|
20234
|
-
}
|
|
20235
|
-
switch (image.align.vertical) {
|
|
20236
|
-
case DAlignVertical.TOP:
|
|
20237
|
-
borderTop += imageMarginVertical;
|
|
20238
|
-
imageImage.y = toRounded(borderTop);
|
|
20239
|
-
borderTop += imageBoundHeight;
|
|
20240
|
-
break;
|
|
20241
|
-
case DAlignVertical.MIDDLE:
|
|
20242
|
-
// DO NOTHING
|
|
20243
|
-
break;
|
|
20244
|
-
case DAlignVertical.BOTTOM:
|
|
20245
|
-
borderBottom -= imageBoundHeight + imageMarginVertical;
|
|
20246
|
-
imageImage.y = toRounded(borderBottom);
|
|
20247
|
-
break;
|
|
20248
|
-
}
|
|
20249
|
-
}
|
|
20250
|
-
}
|
|
20251
|
-
}
|
|
20252
|
-
if (noText) {
|
|
20253
|
-
textRight += textRightLastMargin;
|
|
20254
|
-
textBottom += textBottomLastMargin;
|
|
20529
|
+
layouter.add(image);
|
|
20255
20530
|
}
|
|
20256
|
-
|
|
20257
|
-
var textLeftAdjust = 0;
|
|
20258
|
-
var textCenterAdjust = 0;
|
|
20259
|
-
var textRightAdjust = 0;
|
|
20260
|
-
var textTopAdjust = 0;
|
|
20261
|
-
var textMiddleAdjust = 0;
|
|
20262
|
-
var textBottomAdjust = 0;
|
|
20531
|
+
var text = this._text;
|
|
20263
20532
|
if (text != null) {
|
|
20264
20533
|
this.updateTextColor(text);
|
|
20265
|
-
|
|
20266
|
-
var textAlign = this._textAlign;
|
|
20267
|
-
var textWidth = text.width;
|
|
20268
|
-
var textHeight = text.height;
|
|
20269
|
-
switch (textAlign.horizontal) {
|
|
20270
|
-
case DAlignHorizontal.LEFT:
|
|
20271
|
-
textLeftAdjust = pl;
|
|
20272
|
-
textRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;
|
|
20273
|
-
break;
|
|
20274
|
-
case DAlignHorizontal.CENTER:
|
|
20275
|
-
textLeftAdjust = (width - textLeft + textRight - textWidth) * 0.5;
|
|
20276
|
-
textRightAdjust = textLeftAdjust + textLeft + textWidth - textRight;
|
|
20277
|
-
break;
|
|
20278
|
-
case DAlignHorizontal.RIGHT:
|
|
20279
|
-
textRightAdjust = width - pr;
|
|
20280
|
-
textLeftAdjust = textRightAdjust + textRight - textWidth - textLeft;
|
|
20281
|
-
break;
|
|
20282
|
-
}
|
|
20283
|
-
text.x = toRounded(textLeftAdjust + textLeft);
|
|
20284
|
-
textCenterAdjust = textLeftAdjust + textLeft + textWidth * 0.5;
|
|
20285
|
-
switch (textAlign.vertical) {
|
|
20286
|
-
case DAlignVertical.TOP:
|
|
20287
|
-
textTopAdjust = pt;
|
|
20288
|
-
textBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;
|
|
20289
|
-
break;
|
|
20290
|
-
case DAlignVertical.MIDDLE:
|
|
20291
|
-
textTopAdjust = (height - textTop + textBottom - textHeight) * 0.5;
|
|
20292
|
-
textBottomAdjust = textTopAdjust + textTop + textHeight - textBottom;
|
|
20293
|
-
break;
|
|
20294
|
-
case DAlignVertical.BOTTOM:
|
|
20295
|
-
textBottomAdjust = height - pb;
|
|
20296
|
-
textTopAdjust = textBottomAdjust + textBottom - textHeight - textTop;
|
|
20297
|
-
break;
|
|
20298
|
-
}
|
|
20299
|
-
text.y = toRounded(textTopAdjust + textTop);
|
|
20300
|
-
textMiddleAdjust = textTopAdjust + textTop + textHeight * 0.5;
|
|
20301
|
-
}
|
|
20302
|
-
else {
|
|
20303
|
-
textLeftAdjust = (width - textLeft + textRight) * 0.5;
|
|
20304
|
-
textRightAdjust = textLeftAdjust + textLeft - textRight;
|
|
20305
|
-
textCenterAdjust = textLeftAdjust + textLeft;
|
|
20306
|
-
textTopAdjust = (height - textTop + textBottom) * 0.5;
|
|
20307
|
-
textBottomAdjust = textTopAdjust + textTop - textBottom;
|
|
20308
|
-
textMiddleAdjust = textTopAdjust + textTop;
|
|
20309
|
-
}
|
|
20310
|
-
var paddingCenterAdjust = width * 0.5;
|
|
20311
|
-
var paddingMiddleAdjust = height * 0.5;
|
|
20312
|
-
var borderCenterAdjust = width * 0.5;
|
|
20313
|
-
var borderMiddleAdjust = height * 0.5;
|
|
20314
|
-
for (var i = 0, imax = images.length; i < imax; ++i) {
|
|
20315
|
-
var image = images[i];
|
|
20316
|
-
var imageImage = image.image;
|
|
20317
|
-
if (imageImage) {
|
|
20318
|
-
var imageBound = image.bound;
|
|
20319
|
-
var imageBoundWidth = imageBound.width;
|
|
20320
|
-
var imageBoundHeight = imageBound.height;
|
|
20321
|
-
// Text
|
|
20322
|
-
if (image.align.with === DAlignWith.TEXT) {
|
|
20323
|
-
switch (image.align.horizontal) {
|
|
20324
|
-
case DAlignHorizontal.LEFT:
|
|
20325
|
-
imageImage.x = toRounded(imageImage.x + textLeftAdjust);
|
|
20326
|
-
break;
|
|
20327
|
-
case DAlignHorizontal.CENTER:
|
|
20328
|
-
imageImage.x = toRounded(textCenterAdjust - imageBoundWidth * 0.5);
|
|
20329
|
-
break;
|
|
20330
|
-
case DAlignHorizontal.RIGHT:
|
|
20331
|
-
imageImage.x = toRounded(imageImage.x + textRightAdjust);
|
|
20332
|
-
break;
|
|
20333
|
-
}
|
|
20334
|
-
switch (image.align.vertical) {
|
|
20335
|
-
case DAlignVertical.TOP:
|
|
20336
|
-
imageImage.y = toRounded(imageImage.y + textTopAdjust);
|
|
20337
|
-
break;
|
|
20338
|
-
case DAlignVertical.MIDDLE:
|
|
20339
|
-
imageImage.y = toRounded(textMiddleAdjust - imageBoundHeight * 0.5);
|
|
20340
|
-
break;
|
|
20341
|
-
case DAlignVertical.BOTTOM:
|
|
20342
|
-
imageImage.y = toRounded(imageImage.y + textBottomAdjust);
|
|
20343
|
-
break;
|
|
20344
|
-
}
|
|
20345
|
-
}
|
|
20346
|
-
// Padding
|
|
20347
|
-
if (image.align.with === DAlignWith.PADDING) {
|
|
20348
|
-
switch (image.align.horizontal) {
|
|
20349
|
-
case DAlignHorizontal.CENTER:
|
|
20350
|
-
imageImage.x = toRounded(paddingCenterAdjust - imageBoundWidth * 0.5);
|
|
20351
|
-
break;
|
|
20352
|
-
}
|
|
20353
|
-
switch (image.align.vertical) {
|
|
20354
|
-
case DAlignVertical.MIDDLE:
|
|
20355
|
-
imageImage.y = toRounded(paddingMiddleAdjust - imageBoundHeight * 0.5);
|
|
20356
|
-
break;
|
|
20357
|
-
}
|
|
20358
|
-
}
|
|
20359
|
-
// Border
|
|
20360
|
-
if (image.align.with === DAlignWith.BORDER) {
|
|
20361
|
-
switch (image.align.horizontal) {
|
|
20362
|
-
case DAlignHorizontal.CENTER:
|
|
20363
|
-
imageImage.x = toRounded(borderCenterAdjust - imageBoundWidth * 0.5);
|
|
20364
|
-
break;
|
|
20365
|
-
}
|
|
20366
|
-
switch (image.align.vertical) {
|
|
20367
|
-
case DAlignVertical.MIDDLE:
|
|
20368
|
-
imageImage.y = toRounded(borderMiddleAdjust - imageBoundHeight * 0.5);
|
|
20369
|
-
break;
|
|
20370
|
-
}
|
|
20371
|
-
}
|
|
20372
|
-
}
|
|
20534
|
+
layouter.set(text);
|
|
20373
20535
|
}
|
|
20536
|
+
var auto = this._auto;
|
|
20537
|
+
layouter.execute(this._padding, this._textAlign, auto.width.isOn ? null : this.width, auto.height.isOn ? null : this.height);
|
|
20538
|
+
layouter.clear();
|
|
20374
20539
|
};
|
|
20375
20540
|
DImageBase.prototype.isRefitable = function (target) {
|
|
20376
20541
|
if (_super.prototype.isRefitable.call(this, target)) {
|
|
@@ -22676,9 +22841,6 @@ var DHtmlElement = /** @class */ (function (_super) {
|
|
|
22676
22841
|
this.toGlobal(point, point, true);
|
|
22677
22842
|
result.width = point.x - result.x;
|
|
22678
22843
|
result.height = point.y - result.y;
|
|
22679
|
-
// Rounds pixels as Pixi.js does
|
|
22680
|
-
result.x = ((result.x * resolution) | 0) / resolution;
|
|
22681
|
-
result.y = ((result.y * resolution) | 0) / resolution;
|
|
22682
22844
|
return result;
|
|
22683
22845
|
};
|
|
22684
22846
|
DHtmlElement.prototype.getClipperRect = function (resolution, point, result) {
|
|
@@ -33635,6 +33797,144 @@ var EShapeEmbedded = /** @class */ (function (_super) {
|
|
|
33635
33797
|
return EShapeEmbedded;
|
|
33636
33798
|
}(EShapeGroupViewer));
|
|
33637
33799
|
|
|
33800
|
+
/*
|
|
33801
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
33802
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
33803
|
+
*/
|
|
33804
|
+
var EShapeLayerState = {
|
|
33805
|
+
INVISIBLE: "INVISIBLE",
|
|
33806
|
+
INTERACTIVE: "INTERACTIVE",
|
|
33807
|
+
DRAGGABLE: "DRAGGABLE",
|
|
33808
|
+
PINCHABLE: "PINCHABLE"
|
|
33809
|
+
};
|
|
33810
|
+
|
|
33811
|
+
/*
|
|
33812
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
33813
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
33814
|
+
*/
|
|
33815
|
+
var EShapeEmbeddedLayer = /** @class */ (function (_super) {
|
|
33816
|
+
__extends(EShapeEmbeddedLayer, _super);
|
|
33817
|
+
function EShapeEmbeddedLayer(name, isEditMode, type) {
|
|
33818
|
+
if (type === void 0) { type = EShapeType.EMBEDDED_LAYER; }
|
|
33819
|
+
var _this = _super.call(this, isEditMode, type) || this;
|
|
33820
|
+
_this._name = name;
|
|
33821
|
+
return _this;
|
|
33822
|
+
}
|
|
33823
|
+
Object.defineProperty(EShapeEmbeddedLayer.prototype, "name", {
|
|
33824
|
+
get: function () {
|
|
33825
|
+
return this._name;
|
|
33826
|
+
},
|
|
33827
|
+
enumerable: false,
|
|
33828
|
+
configurable: true
|
|
33829
|
+
});
|
|
33830
|
+
EShapeEmbeddedLayer.prototype.newGroupFill = function () {
|
|
33831
|
+
return new EShapeFillImpl(this, false, 0xffffff, 1);
|
|
33832
|
+
};
|
|
33833
|
+
EShapeEmbeddedLayer.prototype.isGroupSizeFittable = function () {
|
|
33834
|
+
return false;
|
|
33835
|
+
};
|
|
33836
|
+
EShapeEmbeddedLayer.prototype.clone = function () {
|
|
33837
|
+
var result = this.newClone().copy(this);
|
|
33838
|
+
var children = this.children;
|
|
33839
|
+
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
33840
|
+
var clone = children[i].clone();
|
|
33841
|
+
clone.parent = result;
|
|
33842
|
+
result.children.push(clone);
|
|
33843
|
+
}
|
|
33844
|
+
result.onChildTransformChange();
|
|
33845
|
+
result.toDirty();
|
|
33846
|
+
result.size.init();
|
|
33847
|
+
return result;
|
|
33848
|
+
};
|
|
33849
|
+
EShapeEmbeddedLayer.prototype.newClone = function () {
|
|
33850
|
+
var constructor = this.constructor;
|
|
33851
|
+
return new constructor(this._name, this._isEditMode, this.type);
|
|
33852
|
+
};
|
|
33853
|
+
EShapeEmbeddedLayer.prototype.serializeChildren = function (manager) {
|
|
33854
|
+
return [];
|
|
33855
|
+
};
|
|
33856
|
+
EShapeEmbeddedLayer.prototype.serializeImage = function (manager) {
|
|
33857
|
+
return -1;
|
|
33858
|
+
};
|
|
33859
|
+
EShapeEmbeddedLayer.prototype.serializeGradient = function (manager) {
|
|
33860
|
+
return -1;
|
|
33861
|
+
};
|
|
33862
|
+
EShapeEmbeddedLayer.deserialize = function (serialized, manager, width, height) {
|
|
33863
|
+
var _a, _b, _c;
|
|
33864
|
+
var result = new EShapeEmbeddedLayer(this.deserializeName(serialized[0], manager), manager.isEditMode);
|
|
33865
|
+
var visibility = serialized[1];
|
|
33866
|
+
var visible = visibility == null || !!(visibility & 0x2);
|
|
33867
|
+
if (!visible) {
|
|
33868
|
+
result.visible = false;
|
|
33869
|
+
result.state.add(EShapeLayerState.INVISIBLE);
|
|
33870
|
+
}
|
|
33871
|
+
var positionX = -0.5 * width + (serialized[2] || 0);
|
|
33872
|
+
var positionY = -0.5 * height + (serialized[3] || 0);
|
|
33873
|
+
result.transform.position.set(positionX, positionY);
|
|
33874
|
+
var sizeX = (_a = serialized[4]) !== null && _a !== void 0 ? _a : width;
|
|
33875
|
+
var sizeY = (_b = serialized[5]) !== null && _b !== void 0 ? _b : height;
|
|
33876
|
+
result.size.set(sizeX, sizeY);
|
|
33877
|
+
var fillId = serialized[6];
|
|
33878
|
+
if (fillId != null) {
|
|
33879
|
+
result.fill.deserialize(fillId, manager);
|
|
33880
|
+
}
|
|
33881
|
+
if (!manager.isEditMode) {
|
|
33882
|
+
var state = (_c = serialized[7]) !== null && _c !== void 0 ? _c : 1;
|
|
33883
|
+
var isInteractive = state & 0x1;
|
|
33884
|
+
var isDraggable = state & 0x2;
|
|
33885
|
+
var isPinchable = state & 0x4;
|
|
33886
|
+
if (isDraggable || isPinchable) {
|
|
33887
|
+
var gestureType = (isDraggable
|
|
33888
|
+
? EShapeActionValueMiscGestureType.DRAG
|
|
33889
|
+
: EShapeActionValueMiscGestureType.NONE) |
|
|
33890
|
+
(isPinchable
|
|
33891
|
+
? EShapeActionValueMiscGestureType.PINCH
|
|
33892
|
+
: EShapeActionValueMiscGestureType.NONE);
|
|
33893
|
+
result.action.add(new EShapeActionValueMiscLayerGesture("", gestureType));
|
|
33894
|
+
}
|
|
33895
|
+
if (isInteractive || isDraggable || isPinchable) {
|
|
33896
|
+
result.interactive = true;
|
|
33897
|
+
}
|
|
33898
|
+
}
|
|
33899
|
+
return result;
|
|
33900
|
+
};
|
|
33901
|
+
EShapeEmbeddedLayer.deserializeName = function (target, manager) {
|
|
33902
|
+
if (isString(target)) {
|
|
33903
|
+
return target;
|
|
33904
|
+
}
|
|
33905
|
+
else {
|
|
33906
|
+
var resources = manager.resources;
|
|
33907
|
+
if (0 <= target && target <= resources.length) {
|
|
33908
|
+
return resources[target];
|
|
33909
|
+
}
|
|
33910
|
+
return "";
|
|
33911
|
+
}
|
|
33912
|
+
};
|
|
33913
|
+
return EShapeEmbeddedLayer;
|
|
33914
|
+
}(EShapeGroupViewer));
|
|
33915
|
+
|
|
33916
|
+
/*
|
|
33917
|
+
* Copyright (C) 2019 Toshiba Corporation
|
|
33918
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
33919
|
+
*/
|
|
33920
|
+
var EShapeRectangle = /** @class */ (function (_super) {
|
|
33921
|
+
__extends(EShapeRectangle, _super);
|
|
33922
|
+
function EShapeRectangle(type) {
|
|
33923
|
+
if (type === void 0) { type = EShapeType.RECTANGLE; }
|
|
33924
|
+
return _super.call(this, type) || this;
|
|
33925
|
+
}
|
|
33926
|
+
EShapeRectangle.prototype.clone = function () {
|
|
33927
|
+
return new EShapeRectangle(this.type).copy(this);
|
|
33928
|
+
};
|
|
33929
|
+
EShapeRectangle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
33930
|
+
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
33931
|
+
return hitTestRectangle(this, x, y, ax, ay, sw, ss);
|
|
33932
|
+
}
|
|
33933
|
+
return false;
|
|
33934
|
+
};
|
|
33935
|
+
return EShapeRectangle;
|
|
33936
|
+
}(EShapePrimitive));
|
|
33937
|
+
|
|
33638
33938
|
/*
|
|
33639
33939
|
* Copyright (C) 2019 Toshiba Corporation
|
|
33640
33940
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -33651,6 +33951,31 @@ var create = function (name, width, height, container, manager, item) {
|
|
|
33651
33951
|
shape.size.set(sizeX, sizeY);
|
|
33652
33952
|
return result;
|
|
33653
33953
|
};
|
|
33954
|
+
var createMissing = function (name, manager, item) {
|
|
33955
|
+
var shape = new EShapeEmbedded(name, manager.isEditMode);
|
|
33956
|
+
var result = deserializeBase(item, manager, shape);
|
|
33957
|
+
var size = shape.size;
|
|
33958
|
+
var sizeX = size.x;
|
|
33959
|
+
var sizeY = size.y;
|
|
33960
|
+
var children = shape.children;
|
|
33961
|
+
var layer = new EShapeEmbeddedLayer("missing", manager.isEditMode);
|
|
33962
|
+
var px = 0.5 * sizeX;
|
|
33963
|
+
var py = 0.5 * sizeX;
|
|
33964
|
+
layer.transform.position.set(-px, -py);
|
|
33965
|
+
layer.size.set(sizeX, sizeY);
|
|
33966
|
+
layer.parent = shape;
|
|
33967
|
+
var rectangle = new EShapeRectangle();
|
|
33968
|
+
rectangle.stroke.color = 0xff0000;
|
|
33969
|
+
rectangle.transform.position.set(px, py);
|
|
33970
|
+
rectangle.size.copyFrom(shape.size);
|
|
33971
|
+
rectangle.attach(layer);
|
|
33972
|
+
children.push(layer);
|
|
33973
|
+
shape.onChildTransformChange();
|
|
33974
|
+
shape.toDirty();
|
|
33975
|
+
shape.onAttach();
|
|
33976
|
+
shape.size.init();
|
|
33977
|
+
return result;
|
|
33978
|
+
};
|
|
33654
33979
|
var deserializeEmbedded = function (item, manager) {
|
|
33655
33980
|
var pieces = manager.pieces;
|
|
33656
33981
|
var pieceId = item[15];
|
|
@@ -33662,6 +33987,9 @@ var deserializeEmbedded = function (item, manager) {
|
|
|
33662
33987
|
if (pieceDatum) {
|
|
33663
33988
|
return create(piece, pieceDatum.width, pieceDatum.height, pieceDatum.layer, manager, item);
|
|
33664
33989
|
}
|
|
33990
|
+
else {
|
|
33991
|
+
return createMissing(piece, manager, item);
|
|
33992
|
+
}
|
|
33665
33993
|
}
|
|
33666
33994
|
}
|
|
33667
33995
|
return null;
|
|
@@ -34592,28 +34920,6 @@ var createRectangleUploaded = function (buffer, shape, voffset, ioffset, antiali
|
|
|
34592
34920
|
return null;
|
|
34593
34921
|
};
|
|
34594
34922
|
|
|
34595
|
-
/*
|
|
34596
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
34597
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
34598
|
-
*/
|
|
34599
|
-
var EShapeRectangle = /** @class */ (function (_super) {
|
|
34600
|
-
__extends(EShapeRectangle, _super);
|
|
34601
|
-
function EShapeRectangle(type) {
|
|
34602
|
-
if (type === void 0) { type = EShapeType.RECTANGLE; }
|
|
34603
|
-
return _super.call(this, type) || this;
|
|
34604
|
-
}
|
|
34605
|
-
EShapeRectangle.prototype.clone = function () {
|
|
34606
|
-
return new EShapeRectangle(this.type).copy(this);
|
|
34607
|
-
};
|
|
34608
|
-
EShapeRectangle.prototype.containsAbs = function (x, y, ax, ay, sw, ss, sa) {
|
|
34609
|
-
if (_super.prototype.containsAbsBBox.call(this, x, y, ax, ay)) {
|
|
34610
|
-
return hitTestRectangle(this, x, y, ax, ay, sw, ss);
|
|
34611
|
-
}
|
|
34612
|
-
return false;
|
|
34613
|
-
};
|
|
34614
|
-
return EShapeRectangle;
|
|
34615
|
-
}(EShapePrimitive));
|
|
34616
|
-
|
|
34617
34923
|
/*
|
|
34618
34924
|
* Copyright (C) 2019 Toshiba Corporation
|
|
34619
34925
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -38054,122 +38360,6 @@ var EShapeConnectors = /** @class */ (function () {
|
|
|
38054
38360
|
return EShapeConnectors;
|
|
38055
38361
|
}());
|
|
38056
38362
|
|
|
38057
|
-
/*
|
|
38058
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
38059
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
38060
|
-
*/
|
|
38061
|
-
var EShapeLayerState = {
|
|
38062
|
-
INVISIBLE: "INVISIBLE",
|
|
38063
|
-
INTERACTIVE: "INTERACTIVE",
|
|
38064
|
-
DRAGGABLE: "DRAGGABLE",
|
|
38065
|
-
PINCHABLE: "PINCHABLE"
|
|
38066
|
-
};
|
|
38067
|
-
|
|
38068
|
-
/*
|
|
38069
|
-
* Copyright (C) 2019 Toshiba Corporation
|
|
38070
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
38071
|
-
*/
|
|
38072
|
-
var EShapeEmbeddedLayer = /** @class */ (function (_super) {
|
|
38073
|
-
__extends(EShapeEmbeddedLayer, _super);
|
|
38074
|
-
function EShapeEmbeddedLayer(name, isEditMode, type) {
|
|
38075
|
-
if (type === void 0) { type = EShapeType.EMBEDDED_LAYER; }
|
|
38076
|
-
var _this = _super.call(this, isEditMode, type) || this;
|
|
38077
|
-
_this._name = name;
|
|
38078
|
-
return _this;
|
|
38079
|
-
}
|
|
38080
|
-
Object.defineProperty(EShapeEmbeddedLayer.prototype, "name", {
|
|
38081
|
-
get: function () {
|
|
38082
|
-
return this._name;
|
|
38083
|
-
},
|
|
38084
|
-
enumerable: false,
|
|
38085
|
-
configurable: true
|
|
38086
|
-
});
|
|
38087
|
-
EShapeEmbeddedLayer.prototype.newGroupFill = function () {
|
|
38088
|
-
return new EShapeFillImpl(this, false, 0xffffff, 1);
|
|
38089
|
-
};
|
|
38090
|
-
EShapeEmbeddedLayer.prototype.isGroupSizeFittable = function () {
|
|
38091
|
-
return false;
|
|
38092
|
-
};
|
|
38093
|
-
EShapeEmbeddedLayer.prototype.clone = function () {
|
|
38094
|
-
var result = this.newClone().copy(this);
|
|
38095
|
-
var children = this.children;
|
|
38096
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
38097
|
-
var clone = children[i].clone();
|
|
38098
|
-
clone.parent = result;
|
|
38099
|
-
result.children.push(clone);
|
|
38100
|
-
}
|
|
38101
|
-
result.onChildTransformChange();
|
|
38102
|
-
result.toDirty();
|
|
38103
|
-
result.size.init();
|
|
38104
|
-
return result;
|
|
38105
|
-
};
|
|
38106
|
-
EShapeEmbeddedLayer.prototype.newClone = function () {
|
|
38107
|
-
var constructor = this.constructor;
|
|
38108
|
-
return new constructor(this._name, this._isEditMode, this.type);
|
|
38109
|
-
};
|
|
38110
|
-
EShapeEmbeddedLayer.prototype.serializeChildren = function (manager) {
|
|
38111
|
-
return [];
|
|
38112
|
-
};
|
|
38113
|
-
EShapeEmbeddedLayer.prototype.serializeImage = function (manager) {
|
|
38114
|
-
return -1;
|
|
38115
|
-
};
|
|
38116
|
-
EShapeEmbeddedLayer.prototype.serializeGradient = function (manager) {
|
|
38117
|
-
return -1;
|
|
38118
|
-
};
|
|
38119
|
-
EShapeEmbeddedLayer.deserialize = function (serialized, manager, width, height) {
|
|
38120
|
-
var _a, _b, _c;
|
|
38121
|
-
var result = new EShapeEmbeddedLayer(this.deserializeName(serialized[0], manager), manager.isEditMode);
|
|
38122
|
-
var visibility = serialized[1];
|
|
38123
|
-
var visible = visibility == null || !!(visibility & 0x2);
|
|
38124
|
-
if (!visible) {
|
|
38125
|
-
result.visible = false;
|
|
38126
|
-
result.state.add(EShapeLayerState.INVISIBLE);
|
|
38127
|
-
}
|
|
38128
|
-
var positionX = -0.5 * width + (serialized[2] || 0);
|
|
38129
|
-
var positionY = -0.5 * height + (serialized[3] || 0);
|
|
38130
|
-
result.transform.position.set(positionX, positionY);
|
|
38131
|
-
var sizeX = (_a = serialized[4]) !== null && _a !== void 0 ? _a : width;
|
|
38132
|
-
var sizeY = (_b = serialized[5]) !== null && _b !== void 0 ? _b : height;
|
|
38133
|
-
result.size.set(sizeX, sizeY);
|
|
38134
|
-
var fillId = serialized[6];
|
|
38135
|
-
if (fillId != null) {
|
|
38136
|
-
result.fill.deserialize(fillId, manager);
|
|
38137
|
-
}
|
|
38138
|
-
if (!manager.isEditMode) {
|
|
38139
|
-
var state = (_c = serialized[7]) !== null && _c !== void 0 ? _c : 1;
|
|
38140
|
-
var isInteractive = state & 0x1;
|
|
38141
|
-
var isDraggable = state & 0x2;
|
|
38142
|
-
var isPinchable = state & 0x4;
|
|
38143
|
-
if (isDraggable || isPinchable) {
|
|
38144
|
-
var gestureType = (isDraggable
|
|
38145
|
-
? EShapeActionValueMiscGestureType.DRAG
|
|
38146
|
-
: EShapeActionValueMiscGestureType.NONE) |
|
|
38147
|
-
(isPinchable
|
|
38148
|
-
? EShapeActionValueMiscGestureType.PINCH
|
|
38149
|
-
: EShapeActionValueMiscGestureType.NONE);
|
|
38150
|
-
result.action.add(new EShapeActionValueMiscLayerGesture("", gestureType));
|
|
38151
|
-
}
|
|
38152
|
-
if (isInteractive || isDraggable || isPinchable) {
|
|
38153
|
-
result.interactive = true;
|
|
38154
|
-
}
|
|
38155
|
-
}
|
|
38156
|
-
return result;
|
|
38157
|
-
};
|
|
38158
|
-
EShapeEmbeddedLayer.deserializeName = function (target, manager) {
|
|
38159
|
-
if (isString(target)) {
|
|
38160
|
-
return target;
|
|
38161
|
-
}
|
|
38162
|
-
else {
|
|
38163
|
-
var resources = manager.resources;
|
|
38164
|
-
if (0 <= target && target <= resources.length) {
|
|
38165
|
-
return resources[target];
|
|
38166
|
-
}
|
|
38167
|
-
return "";
|
|
38168
|
-
}
|
|
38169
|
-
};
|
|
38170
|
-
return EShapeEmbeddedLayer;
|
|
38171
|
-
}(EShapeGroupViewer));
|
|
38172
|
-
|
|
38173
38363
|
/*
|
|
38174
38364
|
* Copyright (C) 2019 Toshiba Corporation
|
|
38175
38365
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -38859,8 +39049,24 @@ var DMenuItemText = /** @class */ (function (_super) {
|
|
|
38859
39049
|
var text = this._shortcutText;
|
|
38860
39050
|
var margin = this._shortcutMargin;
|
|
38861
39051
|
if (text != null && margin != null) {
|
|
38862
|
-
var
|
|
38863
|
-
|
|
39052
|
+
var auto = this._auto;
|
|
39053
|
+
var textX = 0;
|
|
39054
|
+
if (auto.width.isOn) {
|
|
39055
|
+
textX = margin;
|
|
39056
|
+
}
|
|
39057
|
+
else {
|
|
39058
|
+
textX = this.width - text.width - margin;
|
|
39059
|
+
}
|
|
39060
|
+
var textY = 0;
|
|
39061
|
+
var padding = this._padding;
|
|
39062
|
+
var ptop = padding.getTop();
|
|
39063
|
+
if (auto.height.isOn) {
|
|
39064
|
+
textY = ptop;
|
|
39065
|
+
}
|
|
39066
|
+
else {
|
|
39067
|
+
textY = ptop + (this.height - ptop - padding.getBottom() - text.height) * 0.5;
|
|
39068
|
+
}
|
|
39069
|
+
text.position.set(textX, textY);
|
|
38864
39070
|
}
|
|
38865
39071
|
};
|
|
38866
39072
|
DMenuItemText.prototype.updateTextColor = function (text) {
|
|
@@ -46701,8 +46907,8 @@ var DThemeWhiteInput = /** @class */ (function (_super) {
|
|
|
46701
46907
|
DThemeWhiteInput.prototype.getSelect = function () {
|
|
46702
46908
|
return true;
|
|
46703
46909
|
};
|
|
46704
|
-
DThemeWhiteInput.prototype.
|
|
46705
|
-
return "
|
|
46910
|
+
DThemeWhiteInput.prototype.getElementStyleBorder = function (state) {
|
|
46911
|
+
return "border: 1px solid transparent; box-sizing: border-box;";
|
|
46706
46912
|
};
|
|
46707
46913
|
return DThemeWhiteInput;
|
|
46708
46914
|
}(DThemeWhiteHtmlElement));
|
|
@@ -55309,8 +55515,8 @@ var DThemeDarkInput = /** @class */ (function (_super) {
|
|
|
55309
55515
|
DThemeDarkInput.prototype.getSelect = function () {
|
|
55310
55516
|
return true;
|
|
55311
55517
|
};
|
|
55312
|
-
DThemeDarkInput.prototype.
|
|
55313
|
-
return "
|
|
55518
|
+
DThemeDarkInput.prototype.getElementStyleBorder = function (state) {
|
|
55519
|
+
return "border: 1px solid transparent; box-sizing: border-box;";
|
|
55314
55520
|
};
|
|
55315
55521
|
return DThemeDarkInput;
|
|
55316
55522
|
}(DThemeDarkHtmlElement));
|
|
@@ -59352,7 +59558,9 @@ var DynamicFontAtlasFont = /** @class */ (function () {
|
|
|
59352
59558
|
this.height = size + padding * 2;
|
|
59353
59559
|
var metrics = pixi_js.TextMetrics.measureFont(fontId);
|
|
59354
59560
|
this.ascent = metrics.ascent;
|
|
59355
|
-
|
|
59561
|
+
// Becase the descent returned by TextMatrics#measureFont is tend
|
|
59562
|
+
// to be the half of the actual descent browsers use internally.
|
|
59563
|
+
this.descent = metrics.descent * 2;
|
|
59356
59564
|
}
|
|
59357
59565
|
return DynamicFontAtlasFont;
|
|
59358
59566
|
}());
|
|
@@ -61324,7 +61532,6 @@ var DApplicationLayer = /** @class */ (function (_super) {
|
|
|
61324
61532
|
_this._isOverlay = options.isOverlay();
|
|
61325
61533
|
_this._padding = options.getPadding();
|
|
61326
61534
|
_this._rootElement = options.getRootElement();
|
|
61327
|
-
_this._refitLimit = 5;
|
|
61328
61535
|
_this._reflowLimit = 5;
|
|
61329
61536
|
_this._elementContainer = _this.newElementContainer();
|
|
61330
61537
|
_this.application = application;
|
|
@@ -61518,7 +61725,6 @@ var DApplicationLayer = /** @class */ (function (_super) {
|
|
|
61518
61725
|
}
|
|
61519
61726
|
};
|
|
61520
61727
|
DApplicationLayer.prototype.render = function () {
|
|
61521
|
-
this.refit();
|
|
61522
61728
|
this.reflow();
|
|
61523
61729
|
// Please note why the following line is here.
|
|
61524
61730
|
//
|
|
@@ -61554,32 +61760,16 @@ var DApplicationLayer = /** @class */ (function (_super) {
|
|
|
61554
61760
|
enumerable: false,
|
|
61555
61761
|
configurable: true
|
|
61556
61762
|
});
|
|
61557
|
-
DApplicationLayer.prototype.refit = function () {
|
|
61558
|
-
var children = this.stage.children;
|
|
61559
|
-
for (var ilimit = 0, limit = this._refitLimit; ilimit < limit; ++ilimit) {
|
|
61560
|
-
var isChildrenDirty = false;
|
|
61561
|
-
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
61562
|
-
var child = children[i];
|
|
61563
|
-
if (child instanceof DBase) {
|
|
61564
|
-
child.refit();
|
|
61565
|
-
isChildrenDirty = isChildrenDirty || child.isChildrenDirty();
|
|
61566
|
-
}
|
|
61567
|
-
}
|
|
61568
|
-
// If DBases are changed during the `refit` process, need to refit again.
|
|
61569
|
-
if (!isChildrenDirty) {
|
|
61570
|
-
break;
|
|
61571
|
-
}
|
|
61572
|
-
}
|
|
61573
|
-
};
|
|
61574
61763
|
DApplicationLayer.prototype.reflow = function () {
|
|
61575
61764
|
var children = this.stage.children;
|
|
61576
|
-
for (var ilimit = 0, limit = this.
|
|
61765
|
+
for (var ilimit = 0, limit = this._reflowLimit; ilimit < limit; ++ilimit) {
|
|
61577
61766
|
var isDirty = false;
|
|
61578
61767
|
for (var i = 0, imax = children.length; i < imax; ++i) {
|
|
61579
61768
|
var child = children[i];
|
|
61580
61769
|
if (child instanceof DBase) {
|
|
61581
61770
|
child.reflow();
|
|
61582
|
-
isDirty =
|
|
61771
|
+
isDirty =
|
|
61772
|
+
isDirty || child.isDirty() || child.hasDirty() || child.isHierarchyDirty();
|
|
61583
61773
|
}
|
|
61584
61774
|
}
|
|
61585
61775
|
// If DBases are changed during the `reflow` process, need to reflow again.
|
|
@@ -63329,8 +63519,12 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
63329
63519
|
};
|
|
63330
63520
|
this._anchors = [];
|
|
63331
63521
|
//
|
|
63522
|
+
var recentColumn = theme.getGradientRecentColumn();
|
|
63523
|
+
var recentWidth = theme.getGradientRecentWidth();
|
|
63524
|
+
var recentMargin = theme.getGradientRecentMargin();
|
|
63525
|
+
var recentWidthAndMargin = recentWidth + recentMargin;
|
|
63332
63526
|
var inputLabelWidth = picker.theme.getInputLabelWidth();
|
|
63333
|
-
var inputWidth =
|
|
63527
|
+
var inputWidth = recentWidth * recentColumn + recentMargin * (recentColumn - 1);
|
|
63334
63528
|
var inputMargin = 5;
|
|
63335
63529
|
var inputDirectionMargin = theme.getGradientDirectionMargin();
|
|
63336
63530
|
var inputDirectionTexture = theme.getGradientDirectionTexture();
|
|
@@ -63339,7 +63533,7 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
63339
63533
|
parent: this,
|
|
63340
63534
|
x: inputLeft + inputLabelWidth + inputMargin,
|
|
63341
63535
|
y: paddingTop,
|
|
63342
|
-
width: inputWidth - inputLabelWidth
|
|
63536
|
+
width: inputWidth - (inputLabelWidth + inputMargin) * 2,
|
|
63343
63537
|
step: 1,
|
|
63344
63538
|
image: {
|
|
63345
63539
|
source: inputDirectionTexture,
|
|
@@ -63357,10 +63551,6 @@ var DPickerColorGradient = /** @class */ (function (_super) {
|
|
|
63357
63551
|
}
|
|
63358
63552
|
});
|
|
63359
63553
|
// Recent gradients
|
|
63360
|
-
var recentColumn = theme.getGradientRecentColumn();
|
|
63361
|
-
var recentWidth = theme.getGradientRecentWidth();
|
|
63362
|
-
var recentMargin = theme.getGradientRecentMargin();
|
|
63363
|
-
var recentWidthAndMargin = recentWidth + recentMargin;
|
|
63364
63554
|
var x0 = inputLeft;
|
|
63365
63555
|
var y0 = inputDirection.y + inputDirection.height + inputDirectionMargin;
|
|
63366
63556
|
if (DPickerColorGradient.RECENT_COLOR_GRADIENT == null) {
|
|
@@ -71958,16 +72148,6 @@ var DDiagramSnapshot = /** @class */ (function (_super) {
|
|
|
71958
72148
|
}
|
|
71959
72149
|
return cleanup === true || cleanup.background === true;
|
|
71960
72150
|
};
|
|
71961
|
-
DDiagramSnapshot.prototype.toCleanupRefit = function (options) {
|
|
71962
|
-
if (options == null) {
|
|
71963
|
-
return true;
|
|
71964
|
-
}
|
|
71965
|
-
var cleanup = options.cleanup;
|
|
71966
|
-
if (cleanup == null || cleanup === true) {
|
|
71967
|
-
return true;
|
|
71968
|
-
}
|
|
71969
|
-
return cleanup !== false && cleanup.refit !== false;
|
|
71970
|
-
};
|
|
71971
72151
|
DDiagramSnapshot.prototype.toCleanupReflow = function (options) {
|
|
71972
72152
|
if (options == null) {
|
|
71973
72153
|
return true;
|
|
@@ -72017,17 +72197,11 @@ var DDiagramSnapshot = /** @class */ (function (_super) {
|
|
|
72017
72197
|
}
|
|
72018
72198
|
}
|
|
72019
72199
|
// Refit & reflow
|
|
72020
|
-
var refit = this.toCleanupRefit(options);
|
|
72021
72200
|
var reflow = this.toCleanupReflow(options);
|
|
72022
|
-
if (
|
|
72201
|
+
if (reflow) {
|
|
72023
72202
|
var layer = DApplications.getLayer(canvas);
|
|
72024
72203
|
if (layer) {
|
|
72025
|
-
|
|
72026
|
-
layer.refit();
|
|
72027
|
-
}
|
|
72028
|
-
if (reflow) {
|
|
72029
|
-
layer.reflow();
|
|
72030
|
-
}
|
|
72204
|
+
layer.reflow();
|
|
72031
72205
|
}
|
|
72032
72206
|
}
|
|
72033
72207
|
// Extracts
|
|
@@ -76155,12 +76329,12 @@ var DMenuSided = /** @class */ (function (_super) {
|
|
|
76155
76329
|
DMenuSided.prototype.newSelection = function (options) {
|
|
76156
76330
|
return new DMenuSidedSelection(this.content, options);
|
|
76157
76331
|
};
|
|
76158
|
-
DMenuSided.prototype.
|
|
76332
|
+
DMenuSided.prototype.onHierarchyDirty = function () {
|
|
76159
76333
|
var selection = this._selection;
|
|
76160
76334
|
if (selection != null) {
|
|
76161
76335
|
selection.toDirty();
|
|
76162
76336
|
}
|
|
76163
|
-
_super.prototype.
|
|
76337
|
+
_super.prototype.onHierarchyDirty.call(this);
|
|
76164
76338
|
};
|
|
76165
76339
|
DMenuSided.prototype.newItems = function (items, sticky) {
|
|
76166
76340
|
DMenuSideds.newItems(this.content, items, sticky);
|