@wcardinal/wcardinal-ui 0.458.0-beta.1 → 0.458.0-beta.3

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.
Files changed (31) hide show
  1. package/dist/types/wcardinal/ui/shape/variant/e-shape-base.d.ts +9 -0
  2. package/dist/types/wcardinal/ui/shape/variant/e-shape-polygon.d.ts +5 -2
  3. package/dist/types/wcardinal/ui/shape/variant/index.d.ts +2 -0
  4. package/dist/wcardinal/ui/shape/variant/e-shape-base.js +12 -1
  5. package/dist/wcardinal/ui/shape/variant/e-shape-base.js.map +1 -1
  6. package/dist/wcardinal/ui/shape/variant/e-shape-polygon.js +7 -5
  7. package/dist/wcardinal/ui/shape/variant/e-shape-polygon.js.map +1 -1
  8. package/dist/wcardinal/ui/shape/variant/hit-test-polygon.js +3 -1
  9. package/dist/wcardinal/ui/shape/variant/hit-test-polygon.js.map +1 -1
  10. package/dist/wcardinal/ui/shape/variant/index.js +2 -0
  11. package/dist/wcardinal/ui/shape/variant/index.js.map +1 -1
  12. package/dist/wcardinal-ui-theme-dark-en-us.js +1 -1
  13. package/dist/wcardinal-ui-theme-dark-en-us.min.js +1 -1
  14. package/dist/wcardinal-ui-theme-dark-ja-jp.js +1 -1
  15. package/dist/wcardinal-ui-theme-dark-ja-jp.min.js +1 -1
  16. package/dist/wcardinal-ui-theme-dark.js +1 -1
  17. package/dist/wcardinal-ui-theme-dark.min.js +1 -1
  18. package/dist/wcardinal-ui-theme-white-en-us.js +1 -1
  19. package/dist/wcardinal-ui-theme-white-en-us.min.js +1 -1
  20. package/dist/wcardinal-ui-theme-white-ja-jp.js +1 -1
  21. package/dist/wcardinal-ui-theme-white-ja-jp.min.js +1 -1
  22. package/dist/wcardinal-ui-theme-white.js +1 -1
  23. package/dist/wcardinal-ui-theme-white.min.js +1 -1
  24. package/dist/wcardinal-ui.cjs.js +24 -38
  25. package/dist/wcardinal-ui.js +24 -38
  26. package/dist/wcardinal-ui.min.js +2 -2
  27. package/dist/wcardinal-ui.min.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/types/wcardinal/ui/shape/variant/e-shape-polygon-stroke.d.ts +0 -16
  30. package/dist/wcardinal/ui/shape/variant/e-shape-polygon-stroke.js +0 -35
  31. package/dist/wcardinal/ui/shape/variant/e-shape-polygon-stroke.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -5194,9 +5194,20 @@ var EShapeBase = /** @class */ (function (_super) {
5194
5194
  var strokeWidth = stroke.enable ? stroke.width : 0;
5195
5195
  var strokeScale = this.getStrokeWidthScale(stroke.style);
5196
5196
  var strokeAlign = stroke.align;
5197
- var s = strokeWidth * strokeScale * strokeAlign;
5197
+ var s = this.toHitTestStrokeShift(strokeWidth, strokeScale, strokeAlign);
5198
5198
  return result.set(0 <= sx ? +dx : -dx, 0 <= sy ? +dy : -dy, Math.abs(sx) + s, Math.abs(sy) + s, strokeWidth, strokeScale, strokeAlign);
5199
5199
  };
5200
+ /**
5201
+ * Returns the stroke shift amount for hit testings.
5202
+ *
5203
+ * @param strokeWidth - The stroke width
5204
+ * @param strokeScale - The stroke scale factor
5205
+ * @param strokeAlign - The stroke alignment
5206
+ * @returns The calculated shift amount
5207
+ */
5208
+ EShapeBase.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
5209
+ return strokeWidth * strokeScale * strokeAlign;
5210
+ };
5200
5211
  EShapeBase.prototype.contains = function (x, y) {
5201
5212
  var data = this.toHitTestData(x, y);
5202
5213
  if (this.containsAbs(data.x, data.y, data.width, data.height, data.strokeWidth, data.strokeScale, data.strokeAlign)) {
@@ -48497,38 +48508,6 @@ var buildPolygonUv = function (uvs, polygonUvs, voffset, textureUvs) {
48497
48508
  }
48498
48509
  };
48499
48510
 
48500
- /*
48501
- * Copyright (C) 2019 Toshiba Corporation
48502
- * SPDX-License-Identifier: Apache-2.0
48503
- */
48504
- /**
48505
- * Since EShapePolygon does not support the stroke alignment,
48506
- * this class keeps the stroke alignment at zero.
48507
- */
48508
- var EShapePolygonStroke = /** @class */ (function (_super) {
48509
- __extends(EShapePolygonStroke, _super);
48510
- function EShapePolygonStroke(parent, enable, color, alpha, width, align, side, style) {
48511
- return _super.call(this, parent, enable, color, alpha, width, 0, side, style) || this;
48512
- }
48513
- Object.defineProperty(EShapePolygonStroke.prototype, "align", {
48514
- get: function () {
48515
- return this._align;
48516
- },
48517
- set: function (align) {
48518
- // EShapePolygon doesn't support the stroke alignment
48519
- },
48520
- enumerable: false,
48521
- configurable: true
48522
- });
48523
- EShapePolygonStroke.prototype.set = function (enable, color, alpha, width, align, side, style) {
48524
- _super.prototype.set.call(this, enable, color, alpha, width, undefined, side, style);
48525
- };
48526
- EShapePolygonStroke.prototype.clone = function () {
48527
- return new EShapePolygonStroke(this._parent, this._enable, this._color, this._alpha, this._width, this._align, this._side, this._style);
48528
- };
48529
- return EShapePolygonStroke;
48530
- }(EShapeStrokeImpl));
48531
-
48532
48511
  var UtilPolygon = /** @class */ (function () {
48533
48512
  function UtilPolygon(epsilon) {
48534
48513
  this.points = [];
@@ -50120,7 +50099,9 @@ var hitTestPolygon = function (shape, x, y, ax, ay, sw, ss) {
50120
50099
  return true;
50121
50100
  }
50122
50101
  else {
50123
- return calcPolygonSquaredDistance(values, valuesLength, x, y) <= sw * sw;
50102
+ var sd = calcPolygonSquaredDistance(values, valuesLength, x, y);
50103
+ var s = sw * ss;
50104
+ return sd <= s * s;
50124
50105
  }
50125
50106
  }
50126
50107
  }
@@ -50154,9 +50135,6 @@ var EShapePolygon = /** @class */ (function (_super) {
50154
50135
  EShapePolygon.prototype.newTriangulated = function () {
50155
50136
  return new EShapePolygonTriangulatedImpl(this);
50156
50137
  };
50157
- EShapePolygon.prototype.newStroke = function () {
50158
- return new EShapePolygonStroke(this, true, EShapeDefaults.STROKE_COLOR, EShapeDefaults.STROKE_ALPHA, EShapeDefaults.STROKE_WIDTH, EShapeDefaults.STROKE_ALIGN, EShapeDefaults.STROKE_SIDE, EShapeDefaults.STROKE_STYLE);
50159
- };
50160
50138
  Object.defineProperty(EShapePolygon.prototype, "triangulated", {
50161
50139
  get: function () {
50162
50140
  return this._triangulated;
@@ -50164,6 +50142,13 @@ var EShapePolygon = /** @class */ (function (_super) {
50164
50142
  enumerable: false,
50165
50143
  configurable: true
50166
50144
  });
50145
+ /**
50146
+ * EShapePolygon does not support stroke alignment,
50147
+ * so always return 0 for hit test stroke shift.
50148
+ */
50149
+ EShapePolygon.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
50150
+ return 0;
50151
+ };
50167
50152
  EShapePolygon.prototype.clone = function () {
50168
50153
  return new EShapePolygon(this.type).copy(this);
50169
50154
  };
@@ -105347,6 +105332,7 @@ exports.EShapePointsMarkerType = EShapePointsMarkerType;
105347
105332
  exports.EShapePointsStyle = EShapePointsStyle;
105348
105333
  exports.EShapePointsStyles = EShapePointsStyles;
105349
105334
  exports.EShapePolygon = EShapePolygon;
105335
+ exports.EShapePolygonTriangulatedImpl = EShapePolygonTriangulatedImpl;
105350
105336
  exports.EShapePrimitive = EShapePrimitive;
105351
105337
  exports.EShapeRectangle = EShapeRectangle;
105352
105338
  exports.EShapeRectanglePivoted = EShapeRectanglePivoted;
@@ -1,5 +1,5 @@
1
1
  /*
2
- Winter Cardinal UI v0.458.0-beta.1
2
+ Winter Cardinal UI v0.458.0-beta.3
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
@@ -5191,9 +5191,20 @@
5191
5191
  var strokeWidth = stroke.enable ? stroke.width : 0;
5192
5192
  var strokeScale = this.getStrokeWidthScale(stroke.style);
5193
5193
  var strokeAlign = stroke.align;
5194
- var s = strokeWidth * strokeScale * strokeAlign;
5194
+ var s = this.toHitTestStrokeShift(strokeWidth, strokeScale, strokeAlign);
5195
5195
  return result.set(0 <= sx ? +dx : -dx, 0 <= sy ? +dy : -dy, Math.abs(sx) + s, Math.abs(sy) + s, strokeWidth, strokeScale, strokeAlign);
5196
5196
  };
5197
+ /**
5198
+ * Returns the stroke shift amount for hit testings.
5199
+ *
5200
+ * @param strokeWidth - The stroke width
5201
+ * @param strokeScale - The stroke scale factor
5202
+ * @param strokeAlign - The stroke alignment
5203
+ * @returns The calculated shift amount
5204
+ */
5205
+ EShapeBase.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
5206
+ return strokeWidth * strokeScale * strokeAlign;
5207
+ };
5197
5208
  EShapeBase.prototype.contains = function (x, y) {
5198
5209
  var data = this.toHitTestData(x, y);
5199
5210
  if (this.containsAbs(data.x, data.y, data.width, data.height, data.strokeWidth, data.strokeScale, data.strokeAlign)) {
@@ -48494,38 +48505,6 @@
48494
48505
  }
48495
48506
  };
48496
48507
 
48497
- /*
48498
- * Copyright (C) 2019 Toshiba Corporation
48499
- * SPDX-License-Identifier: Apache-2.0
48500
- */
48501
- /**
48502
- * Since EShapePolygon does not support the stroke alignment,
48503
- * this class keeps the stroke alignment at zero.
48504
- */
48505
- var EShapePolygonStroke = /** @class */ (function (_super) {
48506
- __extends(EShapePolygonStroke, _super);
48507
- function EShapePolygonStroke(parent, enable, color, alpha, width, align, side, style) {
48508
- return _super.call(this, parent, enable, color, alpha, width, 0, side, style) || this;
48509
- }
48510
- Object.defineProperty(EShapePolygonStroke.prototype, "align", {
48511
- get: function () {
48512
- return this._align;
48513
- },
48514
- set: function (align) {
48515
- // EShapePolygon doesn't support the stroke alignment
48516
- },
48517
- enumerable: false,
48518
- configurable: true
48519
- });
48520
- EShapePolygonStroke.prototype.set = function (enable, color, alpha, width, align, side, style) {
48521
- _super.prototype.set.call(this, enable, color, alpha, width, undefined, side, style);
48522
- };
48523
- EShapePolygonStroke.prototype.clone = function () {
48524
- return new EShapePolygonStroke(this._parent, this._enable, this._color, this._alpha, this._width, this._align, this._side, this._style);
48525
- };
48526
- return EShapePolygonStroke;
48527
- }(EShapeStrokeImpl));
48528
-
48529
48508
  var UtilPolygon = /** @class */ (function () {
48530
48509
  function UtilPolygon(epsilon) {
48531
48510
  this.points = [];
@@ -50117,7 +50096,9 @@
50117
50096
  return true;
50118
50097
  }
50119
50098
  else {
50120
- return calcPolygonSquaredDistance(values, valuesLength, x, y) <= sw * sw;
50099
+ var sd = calcPolygonSquaredDistance(values, valuesLength, x, y);
50100
+ var s = sw * ss;
50101
+ return sd <= s * s;
50121
50102
  }
50122
50103
  }
50123
50104
  }
@@ -50151,9 +50132,6 @@
50151
50132
  EShapePolygon.prototype.newTriangulated = function () {
50152
50133
  return new EShapePolygonTriangulatedImpl(this);
50153
50134
  };
50154
- EShapePolygon.prototype.newStroke = function () {
50155
- return new EShapePolygonStroke(this, true, EShapeDefaults.STROKE_COLOR, EShapeDefaults.STROKE_ALPHA, EShapeDefaults.STROKE_WIDTH, EShapeDefaults.STROKE_ALIGN, EShapeDefaults.STROKE_SIDE, EShapeDefaults.STROKE_STYLE);
50156
- };
50157
50135
  Object.defineProperty(EShapePolygon.prototype, "triangulated", {
50158
50136
  get: function () {
50159
50137
  return this._triangulated;
@@ -50161,6 +50139,13 @@
50161
50139
  enumerable: false,
50162
50140
  configurable: true
50163
50141
  });
50142
+ /**
50143
+ * EShapePolygon does not support stroke alignment,
50144
+ * so always return 0 for hit test stroke shift.
50145
+ */
50146
+ EShapePolygon.prototype.toHitTestStrokeShift = function (strokeWidth, strokeScale, strokeAlign) {
50147
+ return 0;
50148
+ };
50164
50149
  EShapePolygon.prototype.clone = function () {
50165
50150
  return new EShapePolygon(this.type).copy(this);
50166
50151
  };
@@ -83221,6 +83206,7 @@
83221
83206
  EShapeLockPart: EShapeLockPart,
83222
83207
  EShapeLock: EShapeLock,
83223
83208
  EShapeNull: EShapeNull,
83209
+ EShapePolygonTriangulatedImpl: EShapePolygonTriangulatedImpl,
83224
83210
  EShapePolygon: EShapePolygon,
83225
83211
  EShapePrimitive: EShapePrimitive,
83226
83212
  EShapeRectanglePivoted: EShapeRectanglePivoted,