@galacean/effects-threejs 2.8.8 → 2.8.9

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.8.8
6
+ * Version: v2.8.9
7
7
  */
8
8
 
9
9
  'use strict';
@@ -17867,14 +17867,14 @@ exports.CompositionComponent = /*#__PURE__*/ function(Component) {
17867
17867
  }
17868
17868
  }
17869
17869
  }
17870
- if (exports.VFXItem.isComposition(hitTestItem)) {
17871
- if (hitTestItem.getComponent(CompositionComponent).hitTest(ray, x, y, regions, force, options)) {
17872
- hitTestSuccess = true;
17873
- }
17874
- } else {
17875
- if (_this.hitTestRecursive(hitTestItem, ray, x, y, regions, force, options)) {
17876
- hitTestSuccess = true;
17877
- }
17870
+ }
17871
+ if (exports.VFXItem.isComposition(hitTestItem)) {
17872
+ if (hitTestItem.getComponent(CompositionComponent).hitTest(ray, x, y, regions, force, options)) {
17873
+ hitTestSuccess = true;
17874
+ }
17875
+ } else {
17876
+ if (_this.hitTestRecursive(hitTestItem, ray, x, y, regions, force, options)) {
17877
+ hitTestSuccess = true;
17878
17878
  }
17879
17879
  }
17880
17880
  };
@@ -29401,12 +29401,6 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
29401
29401
  } else {
29402
29402
  context.font = style.fontDesc;
29403
29403
  }
29404
- if (style.hasShadow) {
29405
- _this.setupShadow();
29406
- }
29407
- if (style.isOutlined) {
29408
- _this.setupOutline();
29409
- }
29410
29404
  // textColor 统一是 0-1,写入 canvas 时乘 255
29411
29405
  var _style_textColor = style.textColor, r = _style_textColor[0], g = _style_textColor[1], b = _style_textColor[2], a = _style_textColor[3];
29412
29406
  context.fillStyle = "rgba(" + r * 255 + ", " + g * 255 + ", " + b * 255 + ", " + a + ")";
@@ -29447,8 +29441,13 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
29447
29441
  chars: charsArray,
29448
29442
  charOffsetX: charOffsetX
29449
29443
  });
29450
- // 先描边
29451
- if (style.isOutlined && style.outlineWidth > 0) {
29444
+ var hasOutline = style.isOutlined && style.outlineWidth > 0;
29445
+ if (hasOutline) {
29446
+ // 有描边:在描边时启用阴影
29447
+ if (style.hasShadow) {
29448
+ _this.setupShadow();
29449
+ }
29450
+ _this.setupOutline();
29452
29451
  charsInfo.forEach(function(charInfo) {
29453
29452
  var ox = layout.getOffsetX(style, charInfo.width);
29454
29453
  for(var i = 0; i < charInfo.chars.length; i++){
@@ -29458,8 +29457,15 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
29458
29457
  context.strokeText(str, drawX, drawY);
29459
29458
  }
29460
29459
  });
29460
+ // 描边完成后立即禁用阴影,避免填充时重复绘制阴影
29461
+ if (style.hasShadow) {
29462
+ context.shadowColor = "transparent";
29463
+ }
29464
+ }
29465
+ // 填充阶段:无描边时才启用阴影
29466
+ if (!hasOutline && style.hasShadow) {
29467
+ _this.setupShadow();
29461
29468
  }
29462
- // 再填充
29463
29469
  charsInfo.forEach(function(charInfo) {
29464
29470
  var ox = layout.getOffsetX(style, charInfo.width);
29465
29471
  for(var i = 0; i < charInfo.chars.length; i++){
@@ -29469,6 +29475,7 @@ exports.TextComponent = /*#__PURE__*/ function(MaskableGraphic) {
29469
29475
  context.fillText(str, drawX, drawY);
29470
29476
  }
29471
29477
  });
29478
+ // 清理阴影状态
29472
29479
  if (style.hasShadow) {
29473
29480
  context.shadowColor = "transparent";
29474
29481
  }
@@ -31652,7 +31659,7 @@ function getStandardSpriteContent(sprite, transform) {
31652
31659
  return ret;
31653
31660
  }
31654
31661
 
31655
- var version$2 = "2.8.8";
31662
+ var version$2 = "2.8.9";
31656
31663
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
31657
31664
  var standardVersion = /^(\d+)\.(\d+)$/;
31658
31665
  var reverseParticle = false;
@@ -35352,7 +35359,7 @@ registerPlugin("text", TextLoader);
35352
35359
  registerPlugin("sprite", SpriteLoader);
35353
35360
  registerPlugin("particle", ParticleLoader);
35354
35361
  registerPlugin("interact", InteractLoader);
35355
- var version$1 = "2.8.8";
35362
+ var version$1 = "2.8.9";
35356
35363
  logger.info("Core version: " + version$1 + ".");
35357
35364
 
35358
35365
  var _obj;
@@ -36929,7 +36936,7 @@ applyMixins(exports.ThreeTextComponent, [
36929
36936
  */ Mesh.create = function(engine, props) {
36930
36937
  return new ThreeMesh(engine, props);
36931
36938
  };
36932
- var version = "2.8.8";
36939
+ var version = "2.8.9";
36933
36940
  logger.info("THREEJS plugin version: " + version + ".");
36934
36941
 
36935
36942
  exports.ActivationMixerPlayable = ActivationMixerPlayable;