@galacean/effects-threejs 2.5.3 → 2.5.4

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.5.3
6
+ * Version: v2.5.4
7
7
  */
8
8
 
9
9
  'use strict';
@@ -5949,8 +5949,8 @@ function initGLContext() {
5949
5949
  copy(WebGLRenderingContext);
5950
5950
  copy(WebGLRenderingContext.prototype);
5951
5951
  } else {
5952
- initErrors.push(// iOS 16 lockdown mode
5953
- "iOS16 lockdown mode, WebGL Constants not in global");
5952
+ initErrors.push(isIOS() ? // iOS 16 lockdown mode
5953
+ "iOS16 lockdown mode, WebGL Constants not in global" : "WebGL Constants not in global, please check your environment");
5954
5954
  }
5955
5955
  if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
5956
5956
  // @ts-expect-error set default value
@@ -6570,7 +6570,9 @@ function _loadVideo() {
6570
6570
  return [
6571
6571
  2,
6572
6572
  new Promise(function(resolve, reject) {
6573
- var pending = video.play();
6573
+ var pending = video.play().catch(function(e) {
6574
+ reject(e);
6575
+ });
6574
6576
  if (pending) {
6575
6577
  void pending.then(function() {
6576
6578
  return resolve(video);
@@ -26402,14 +26404,10 @@ var TextComponentBase = /*#__PURE__*/ function() {
26402
26404
  _proto.getLineCount = function getLineCount(text, init) {
26403
26405
  var context = this.context;
26404
26406
  var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
26405
- var fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
26406
- var width = this.textLayout.width + this.textStyle.fontOffset;
26407
+ var fontScale = init ? this.textStyle.fontSize / 10 * this.textStyle.fontScale : this.textStyle.fontScale;
26408
+ var width = (this.textLayout.width + this.textStyle.fontOffset) * this.textStyle.fontScale;
26407
26409
  var lineCount = 1;
26408
26410
  var x = 0;
26409
- //设置context.font的字号
26410
- // if (context) {
26411
- // context.font = this.getFontDesc(this.textStyle.fontSize);
26412
- // }
26413
26411
  for(var i = 0; i < text.length; i++){
26414
26412
  var _context_measureText;
26415
26413
  var str = text[i];
@@ -28598,7 +28596,7 @@ function getStandardSpriteContent(sprite, transform) {
28598
28596
  return ret;
28599
28597
  }
28600
28598
 
28601
- var version$2 = "2.5.3";
28599
+ var version$2 = "2.5.4";
28602
28600
  var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
28603
28601
  var standardVersion = /^(\d+)\.(\d+)$/;
28604
28602
  var reverseParticle = false;
@@ -31848,7 +31846,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
31848
31846
  registerPlugin("particle", ParticleLoader, exports.VFXItem);
31849
31847
  registerPlugin("cal", CalculateLoader, exports.VFXItem);
31850
31848
  registerPlugin("interact", InteractLoader, exports.VFXItem);
31851
- var version$1 = "2.5.3";
31849
+ var version$1 = "2.5.4";
31852
31850
  logger.info("Core version: " + version$1 + ".");
31853
31851
 
31854
31852
  var _obj;
@@ -33450,7 +33448,7 @@ setMaxSpriteMeshItemCount(8);
33450
33448
  */ Mesh.create = function(engine, props) {
33451
33449
  return new ThreeMesh(engine, props);
33452
33450
  };
33453
- var version = "2.5.3";
33451
+ var version = "2.5.4";
33454
33452
  logger.info("THREEJS plugin version: " + version + ".");
33455
33453
 
33456
33454
  exports.AbstractPlugin = AbstractPlugin;