@galacean/effects-core 2.5.4 → 2.5.6
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 +23 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -8
- package/dist/index.mjs.map +1 -1
- package/dist/utils/device.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.5.
|
|
6
|
+
* Version: v2.5.6
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -466,6 +466,8 @@ function getPixelRatio() {
|
|
|
466
466
|
}
|
|
467
467
|
return 1;
|
|
468
468
|
}
|
|
469
|
+
// window 对象不存在时需要判断
|
|
470
|
+
var canUseBOM = typeof window !== "undefined";
|
|
469
471
|
function isIOS() {
|
|
470
472
|
// real ios device not in simulator
|
|
471
473
|
return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
|
|
@@ -5916,6 +5918,8 @@ function gpuTimer(gl) {
|
|
|
5916
5918
|
|
|
5917
5919
|
var initErrors = [];
|
|
5918
5920
|
var glContext = {};
|
|
5921
|
+
var IOS16_LOCKDOWN_MODE = "iOS16 lockdown mode, WebGL Constants not in global";
|
|
5922
|
+
var WEBGL_CONSTANTS_NOT_IN_GLOBAL = "WebGL Constants not in global, please check your environment";
|
|
5919
5923
|
if (!initErrors.length) {
|
|
5920
5924
|
initGLContext();
|
|
5921
5925
|
}
|
|
@@ -5927,8 +5931,12 @@ function initGLContext() {
|
|
|
5927
5931
|
copy(WebGLRenderingContext);
|
|
5928
5932
|
copy(WebGLRenderingContext.prototype);
|
|
5929
5933
|
} else {
|
|
5930
|
-
|
|
5931
|
-
|
|
5934
|
+
if (canUseBOM) {
|
|
5935
|
+
initErrors.push(// iOS 16 lockdown mode
|
|
5936
|
+
isIOS() ? IOS16_LOCKDOWN_MODE : WEBGL_CONSTANTS_NOT_IN_GLOBAL);
|
|
5937
|
+
} else {
|
|
5938
|
+
initErrors.push(WEBGL_CONSTANTS_NOT_IN_GLOBAL);
|
|
5939
|
+
}
|
|
5932
5940
|
}
|
|
5933
5941
|
if (!initErrors.length && !("HALF_FLOAT" in glContext)) {
|
|
5934
5942
|
// @ts-expect-error set default value
|
|
@@ -13481,6 +13489,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13481
13489
|
var touchstart = "mousedown";
|
|
13482
13490
|
var touchmove = "mousemove";
|
|
13483
13491
|
var touchend = "mouseup";
|
|
13492
|
+
var touchcancel = "mouseleave";
|
|
13484
13493
|
var getTouchEventValue = function(event, x, y, dx, dy) {
|
|
13485
13494
|
if (dx === void 0) dx = 0;
|
|
13486
13495
|
if (dy === void 0) dy = 0;
|
|
@@ -13534,6 +13543,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13534
13543
|
touchstart = "touchstart";
|
|
13535
13544
|
touchmove = "touchmove";
|
|
13536
13545
|
touchend = "touchend";
|
|
13546
|
+
touchcancel = "touchcancel";
|
|
13537
13547
|
}
|
|
13538
13548
|
var _obj;
|
|
13539
13549
|
this.nativeHandlers = (_obj = {}, _obj[touchstart] = function(event) {
|
|
@@ -13576,6 +13586,7 @@ var EventSystem = /*#__PURE__*/ function() {
|
|
|
13576
13586
|
}
|
|
13577
13587
|
currentTouch = 0;
|
|
13578
13588
|
}, _obj);
|
|
13589
|
+
this.nativeHandlers[touchcancel] = this.nativeHandlers[touchend];
|
|
13579
13590
|
Object.keys(this.nativeHandlers).forEach(function(name) {
|
|
13580
13591
|
var _this_target;
|
|
13581
13592
|
(_this_target = _this.target) == null ? void 0 : _this_target.addEventListener(String(name), _this.nativeHandlers[name]);
|
|
@@ -26382,10 +26393,14 @@ var TextComponentBase = /*#__PURE__*/ function() {
|
|
|
26382
26393
|
_proto.getLineCount = function getLineCount(text, init) {
|
|
26383
26394
|
var context = this.context;
|
|
26384
26395
|
var _this_textLayout = this.textLayout, letterSpace = _this_textLayout.letterSpace, overflow = _this_textLayout.overflow;
|
|
26385
|
-
var fontScale = init ? this.textStyle.fontSize / 10
|
|
26386
|
-
var width =
|
|
26396
|
+
var fontScale = init ? this.textStyle.fontSize / 10 : 1 / this.textStyle.fontScale;
|
|
26397
|
+
var width = this.textLayout.width + this.textStyle.fontOffset;
|
|
26387
26398
|
var lineCount = 1;
|
|
26388
26399
|
var x = 0;
|
|
26400
|
+
//设置context.font的字号
|
|
26401
|
+
// if (context) {
|
|
26402
|
+
// context.font = this.getFontDesc(this.textStyle.fontSize);
|
|
26403
|
+
// }
|
|
26389
26404
|
for(var i = 0; i < text.length; i++){
|
|
26390
26405
|
var _context_measureText;
|
|
26391
26406
|
var str = text[i];
|
|
@@ -28574,7 +28589,7 @@ function getStandardSpriteContent(sprite, transform) {
|
|
|
28574
28589
|
return ret;
|
|
28575
28590
|
}
|
|
28576
28591
|
|
|
28577
|
-
var version$1 = "2.5.
|
|
28592
|
+
var version$1 = "2.5.6";
|
|
28578
28593
|
var v0 = /^(\d+)\.(\d+)\.(\d+)(-(\w+)\.\d+)?$/;
|
|
28579
28594
|
var standardVersion = /^(\d+)\.(\d+)$/;
|
|
28580
28595
|
var reverseParticle = false;
|
|
@@ -31824,7 +31839,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31824
31839
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31825
31840
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31826
31841
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31827
|
-
var version = "2.5.
|
|
31842
|
+
var version = "2.5.6";
|
|
31828
31843
|
logger.info("Core version: " + version + ".");
|
|
31829
31844
|
|
|
31830
31845
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -31951,6 +31966,7 @@ exports.base64ToFile = base64ToFile;
|
|
|
31951
31966
|
exports.blend = blend;
|
|
31952
31967
|
exports.buildLine = buildLine;
|
|
31953
31968
|
exports.calculateTranslation = calculateTranslation;
|
|
31969
|
+
exports.canUseBOM = canUseBOM;
|
|
31954
31970
|
exports.canvasPool = canvasPool;
|
|
31955
31971
|
exports.closePointEps = closePointEps;
|
|
31956
31972
|
exports.colorGradingFrag = colorGradingFrag;
|