From 65ad8db4f916ce957c0fc8bc93e7f84da150f65a Mon Sep 17 00:00:00 2001 From: yiiqii Date: Thu, 7 Dec 2023 11:22:54 +0800 Subject: [PATCH] chore: remove some unused import --- packages/effects-core/src/composition.ts | 2 +- .../src/plugins/text/text-item.ts | 30 +++++++++---------- .../src/plugins/text/text-loader.ts | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/packages/effects-core/src/composition.ts b/packages/effects-core/src/composition.ts index 06be23dbc..8823f63bb 100644 --- a/packages/effects-core/src/composition.ts +++ b/packages/effects-core/src/composition.ts @@ -15,7 +15,7 @@ import type { Texture } from './texture'; import { TextureSourceType } from './texture'; import { RenderFrame } from './render'; import { Camera } from './camera'; -import { setRayFromCamera, intersectRayTriangle, intersectRayBox, intersectRaySphere, quatFromRotation } from './math'; +import { setRayFromCamera, intersectRayTriangle, intersectRayBox, intersectRaySphere } from './math'; import { HitTestType } from './plugins'; import type { Region } from './plugins'; import { CompositionSourceManager } from './composition-source-manager'; diff --git a/packages/effects-core/src/plugins/text/text-item.ts b/packages/effects-core/src/plugins/text/text-item.ts index 5c5e48477..07a7f39ba 100644 --- a/packages/effects-core/src/plugins/text/text-item.ts +++ b/packages/effects-core/src/plugins/text/text-item.ts @@ -1,5 +1,4 @@ import * as spec from '@galacean/effects-specification'; -import type { TextureDataType } from '../../texture'; import { Texture } from '../../texture'; import { TextMesh } from './text-mesh'; import type { TextVFXItem } from './text-vfx-item'; @@ -68,7 +67,7 @@ export class TextItem extends SpriteItem { /** * 设置字号大小 - * @param value 字号 + * @param value - 字号 * @returns */ setFontSize (value: number): void { @@ -84,7 +83,7 @@ export class TextItem extends SpriteItem { /** * 设置字重 - * @param value 字重类型 + * @param value - 字重类型 * @returns */ setFontWeight (value: spec.TextWeight): void { @@ -110,7 +109,7 @@ export class TextItem extends SpriteItem { /** * 设置文本 - * @param value 文本内容 + * @param value - 文本内容 * @returns */ setText (value: string): void { @@ -123,7 +122,7 @@ export class TextItem extends SpriteItem { /** * 设置文本水平布局 - * @param value 布局选项 + * @param value - 布局选项 * @returns */ setTextAlign (value: spec.TextAlignment): void { @@ -136,7 +135,7 @@ export class TextItem extends SpriteItem { /** * 设置文本垂直布局 - * @param value 布局选项 + * @param value - 布局选项 * @returns */ setTextBaseline (value: spec.TextBaseline): void { @@ -149,7 +148,7 @@ export class TextItem extends SpriteItem { /** * 设置文本颜色 - * @param value 颜色内容 + * @param value - 颜色内容 * @returns */ setTextColor (value: spec.RGBAColorValue): void { @@ -162,7 +161,7 @@ export class TextItem extends SpriteItem { /** * 设置文本字体 - * @param value 文本字体 + * @param value - 文本字体 * @returns */ setFontFamily (value: string): void { @@ -175,7 +174,7 @@ export class TextItem extends SpriteItem { /** * 设置外描边文本颜色 - * @param value 颜色内容 + * @param value - 颜色内容 * @returns */ setOutlineColor (value: spec.RGBAColorValue): void { @@ -188,7 +187,7 @@ export class TextItem extends SpriteItem { /** * 设置外描边文本宽度 - * @param value 外描边宽度 + * @param value - 外描边宽度 * @returns */ setOutlineWidth (value: number): void { @@ -201,7 +200,7 @@ export class TextItem extends SpriteItem { /** * 设置阴影模糊 - * @param value 阴影模糊强度 + * @param value - 阴影模糊强度 * @returns */ setShadowBlur (value: number): void { @@ -214,7 +213,7 @@ export class TextItem extends SpriteItem { /** * 设置阴影颜色 - * @param value 阴影颜色 + * @param value - 阴影颜色 * @returns */ setShadowColor (value: spec.RGBAColorValue): void { @@ -227,7 +226,7 @@ export class TextItem extends SpriteItem { /** * 设置阴影水平偏移距离 - * @param value 水平偏移距离 + * @param value - 水平偏移距离 * @returns */ setShadowOffsetX (value: number): void { @@ -240,7 +239,7 @@ export class TextItem extends SpriteItem { /** * 设置阴影水平偏移距离 - * @param value 水平偏移距离 + * @param value - 水平偏移距离 * @returns */ setShadowOffsetY (value: number): void { @@ -253,7 +252,7 @@ export class TextItem extends SpriteItem { /** * 设置字体清晰度 - * @param value 字体清晰度 + * @param value - 字体清晰度 * @returns */ setFontScale (value: number): void { @@ -434,5 +433,4 @@ export class TextItem extends SpriteItem { context!.shadowOffsetX = style.shadowOffsetX ; context!.shadowOffsetY = -style.shadowOffsetY ; } - } diff --git a/packages/effects-core/src/plugins/text/text-loader.ts b/packages/effects-core/src/plugins/text/text-loader.ts index cfc2042bc..469d30263 100644 --- a/packages/effects-core/src/plugins/text/text-loader.ts +++ b/packages/effects-core/src/plugins/text/text-loader.ts @@ -57,6 +57,7 @@ export class TextLoader extends AbstractPlugin { } override onCompositionItemRemoved (composition: Composition, item: VFXItem) { + // FIXME: 此处判断有问题,item 应该先判断 if (item instanceof TextVFXItem && item) { addItem(this.removeItems, item); if (this.addItems.includes(item)) { @@ -76,7 +77,6 @@ export class TextLoader extends AbstractPlugin { removeItem(this.addItems, item); item.content.mesh.mesh.dispose({ material: { textures: DestroyOptions.keep } }); item.dispose(); - } });