@galacean/effects-core 2.8.2 → 2.8.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.
@@ -22,6 +22,11 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
22
22
  context: CanvasRenderingContext2D | null;
23
23
  textLayout: TextLayout;
24
24
  text: string;
25
+ /**
26
+ * 描边/阴影等特效导致的纹理扩容比例 X/Y
27
+ */
28
+ protected effectScaleX: number;
29
+ protected effectScaleY: number;
25
30
  /**
26
31
  * 每一行文本的最大宽度
27
32
  */
@@ -95,6 +100,21 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
95
100
  */
96
101
  protected updateTexture(flipY?: boolean): void;
97
102
  renderText(options: spec.TextContentOptions): void;
103
+ /**
104
+ * 给渲染层用:获取特效扩容比例(描边/阴影导致的纹理扩容)
105
+ * @returns
106
+ */
107
+ getTextureExpandScale(): [number, number];
108
+ /**
109
+ * 获取描边和阴影的 padding 值(单位:px)
110
+ * @returns
111
+ */
112
+ protected getEffectPadding(): {
113
+ padL: number;
114
+ padR: number;
115
+ padT: number;
116
+ padB: number;
117
+ };
98
118
  setAutoWidth(value: boolean): void;
99
119
  /**
100
120
  * 设置文本框宽度
@@ -29,6 +29,12 @@ export declare class TextLayout implements BaseLayout {
29
29
  * @returns - 行高偏移值
30
30
  */
31
31
  getOffsetY(style: TextStyle, lineCount: number, lineHeight: number, fontSize: number, totalLineHeight?: number): number;
32
+ /**
33
+ * 获取初始的水平偏移值
34
+ * @param style - 字体基础数据
35
+ * @param maxWidth - 最大行宽
36
+ * @returns - 水平偏移值
37
+ */
32
38
  getOffsetX(style: TextStyle, maxWidth: number): number;
33
39
  /**
34
40
  * 设置文本框的宽度和高度
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Galacean Effects runtime core for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",