@galacean/effects-core 1.2.1 → 1.2.2

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.
@@ -1,5 +1,4 @@
1
1
  import type * as spec from '@galacean/effects-specification';
2
- import type { JSONValue } from './downloader';
3
2
  import { Downloader } from './downloader';
4
3
  import type { Disposable } from './utils';
5
4
  import type { Scene } from './scene';
@@ -73,6 +72,10 @@ export interface SceneLoadOptions {
73
72
  */
74
73
  speed?: number;
75
74
  }
75
+ /**
76
+ * 被接受用于加载的数据类型
77
+ */
78
+ export type SceneType = string | Scene | Record<string, unknown>;
76
79
  /**
77
80
  * 资源管理器
78
81
  * 用于加载和动效中所有的资源文件,包括图片、插件、图层粒子数据等
@@ -116,7 +119,7 @@ export declare class AssetManager implements Disposable {
116
119
  * @param options - 扩展参数
117
120
  * @returns
118
121
  */
119
- loadScene(url: string | JSONValue | Scene, renderer?: Renderer, options?: {
122
+ loadScene(url: SceneType, renderer?: Renderer, options?: {
120
123
  env: string;
121
124
  }): Promise<Scene>;
122
125
  private precompile;
@@ -1,6 +1,6 @@
1
1
  import * as spec from '@galacean/effects-specification';
2
2
  import type { Ray } from '@galacean/effects-math/es/core/index';
3
- import type { JSONValue } from './downloader';
3
+ import type { SceneType } from './asset-manager';
4
4
  import type { Scene } from './scene';
5
5
  import type { Disposable, LostHandler } from './utils';
6
6
  import { Transform } from './transform';
@@ -138,7 +138,7 @@ export declare class Composition implements Disposable, LostHandler {
138
138
  /**
139
139
  * 合成对应的 url 或者 JSON
140
140
  */
141
- readonly url: string | JSONValue;
141
+ readonly url: SceneType;
142
142
  /**
143
143
  * 合成对象
144
144
  */
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: v1.2.1
6
+ * Version: v1.2.2
7
7
  */
8
8
 
9
9
  'use strict';
@@ -19972,9 +19972,10 @@ var TextItem = /** @class */ (function (_super) {
19972
19972
  if (this.textStyle.fontSize === value) {
19973
19973
  return;
19974
19974
  }
19975
+ // 保证字号变化后位置正常
19976
+ var diff = this.textStyle.fontSize - value;
19977
+ this.textLayout.lineHeight += diff;
19975
19978
  this.textStyle.fontSize = value;
19976
- // 1.5175 = 31.43 / 20
19977
- this.textLayout.lineHeight = this.textStyle.fontSize * 1.5175;
19978
19979
  this.isDirty = true;
19979
19980
  };
19980
19981
  /**