@galacean/effects 1.6.0 → 1.6.1
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/alipay.js +15 -7
- package/dist/alipay.js.map +1 -1
- package/dist/alipay.mjs +15 -7
- package/dist/alipay.mjs.map +1 -1
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/dist/weapp.js +15 -7
- package/dist/weapp.js.map +1 -1
- package/dist/weapp.mjs +15 -7
- package/dist/weapp.mjs.map +1 -1
- package/package.json +3 -3
package/dist/alipay.js
CHANGED
|
@@ -20278,13 +20278,21 @@ var TextLayout = /** @class */ (function () {
|
|
|
20278
20278
|
this.textAlign = textAlign;
|
|
20279
20279
|
this.lineHeight = lineHeight;
|
|
20280
20280
|
}
|
|
20281
|
-
|
|
20281
|
+
/**
|
|
20282
|
+
* 获取初始的行高偏移值
|
|
20283
|
+
* @param style - 字体基础数据
|
|
20284
|
+
* @param lineCount - 渲染行数
|
|
20285
|
+
* @param lineHeight - 渲染时的字体行高
|
|
20286
|
+
* @param fontSize - 渲染时的字体大小
|
|
20287
|
+
* @returns - 行高偏移值
|
|
20288
|
+
*/
|
|
20289
|
+
TextLayout.prototype.getOffsetY = function (style, lineCount, lineHeight, fontSize) {
|
|
20282
20290
|
var offsetResult = 0;
|
|
20283
|
-
var
|
|
20284
|
-
// 计算基础偏移量
|
|
20285
|
-
var baseOffset = (fontSize + outlineWidth) * fontScale;
|
|
20291
|
+
var outlineWidth = style.outlineWidth, fontScale = style.fontScale;
|
|
20286
20292
|
// /3 计算Y轴偏移量,以匹配编辑器行为
|
|
20287
20293
|
var offsetY = (lineHeight - fontSize) / 3;
|
|
20294
|
+
// 计算基础偏移量
|
|
20295
|
+
var baseOffset = fontSize + outlineWidth * fontScale;
|
|
20288
20296
|
var commonCalculation = lineHeight * (lineCount - 1);
|
|
20289
20297
|
switch (this.textBaseline) {
|
|
20290
20298
|
case TextBaseline$1.top:
|
|
@@ -20571,7 +20579,7 @@ var TextItem = /** @class */ (function (_super) {
|
|
|
20571
20579
|
var fontScale = style.fontScale;
|
|
20572
20580
|
var width = (layout.width + style.fontOffset) * fontScale;
|
|
20573
20581
|
var height = layout.height * fontScale;
|
|
20574
|
-
style.fontSize * fontScale;
|
|
20582
|
+
var fontSize = style.fontSize * fontScale;
|
|
20575
20583
|
var lineHeight = layout.lineHeight * fontScale;
|
|
20576
20584
|
this.char = (this.text || '').split('');
|
|
20577
20585
|
this.canvas.width = width;
|
|
@@ -20592,7 +20600,7 @@ var TextItem = /** @class */ (function (_super) {
|
|
|
20592
20600
|
context.fillStyle = "rgba(".concat(style.textColor[0], ", ").concat(style.textColor[1], ", ").concat(style.textColor[2], ", ").concat(style.textColor[3], ")");
|
|
20593
20601
|
var charsInfo = [];
|
|
20594
20602
|
var x = 0;
|
|
20595
|
-
var y = layout.getOffsetY(style, this.lineCount, lineHeight);
|
|
20603
|
+
var y = layout.getOffsetY(style, this.lineCount, lineHeight, fontSize);
|
|
20596
20604
|
var charsArray = [];
|
|
20597
20605
|
var charOffsetX = [];
|
|
20598
20606
|
for (var i = 0; i < this.char.length; i++) {
|
|
@@ -31024,7 +31032,7 @@ Renderer.create = function (canvas, framework, renderOptions) {
|
|
|
31024
31032
|
Engine.create = function (gl) {
|
|
31025
31033
|
return new GLEngine(gl);
|
|
31026
31034
|
};
|
|
31027
|
-
var version = "1.6.
|
|
31035
|
+
var version = "1.6.1";
|
|
31028
31036
|
logger.info('player version: ' + version);
|
|
31029
31037
|
|
|
31030
31038
|
exports.AbstractPlugin = AbstractPlugin;
|