Skip to content

Commit

Permalink
chore: remove some unused import
Browse files Browse the repository at this point in the history
  • Loading branch information
yiiqii committed Dec 7, 2023
1 parent 91b3655 commit 65ad8db
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/effects-core/src/composition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
30 changes: 14 additions & 16 deletions packages/effects-core/src/plugins/text/text-item.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -68,7 +67,7 @@ export class TextItem extends SpriteItem {

/**
* 设置字号大小
* @param value 字号
* @param value - 字号
* @returns
*/
setFontSize (value: number): void {
Expand All @@ -84,7 +83,7 @@ export class TextItem extends SpriteItem {

/**
* 设置字重
* @param value 字重类型
* @param value - 字重类型
* @returns
*/
setFontWeight (value: spec.TextWeight): void {
Expand All @@ -110,7 +109,7 @@ export class TextItem extends SpriteItem {

/**
* 设置文本
* @param value 文本内容
* @param value - 文本内容
* @returns
*/
setText (value: string): void {
Expand All @@ -123,7 +122,7 @@ export class TextItem extends SpriteItem {

/**
* 设置文本水平布局
* @param value 布局选项
* @param value - 布局选项
* @returns
*/
setTextAlign (value: spec.TextAlignment): void {
Expand All @@ -136,7 +135,7 @@ export class TextItem extends SpriteItem {

/**
* 设置文本垂直布局
* @param value 布局选项
* @param value - 布局选项
* @returns
*/
setTextBaseline (value: spec.TextBaseline): void {
Expand All @@ -149,7 +148,7 @@ export class TextItem extends SpriteItem {

/**
* 设置文本颜色
* @param value 颜色内容
* @param value - 颜色内容
* @returns
*/
setTextColor (value: spec.RGBAColorValue): void {
Expand All @@ -162,7 +161,7 @@ export class TextItem extends SpriteItem {

/**
* 设置文本字体
* @param value 文本字体
* @param value - 文本字体
* @returns
*/
setFontFamily (value: string): void {
Expand All @@ -175,7 +174,7 @@ export class TextItem extends SpriteItem {

/**
* 设置外描边文本颜色
* @param value 颜色内容
* @param value - 颜色内容
* @returns
*/
setOutlineColor (value: spec.RGBAColorValue): void {
Expand All @@ -188,7 +187,7 @@ export class TextItem extends SpriteItem {

/**
* 设置外描边文本宽度
* @param value 外描边宽度
* @param value - 外描边宽度
* @returns
*/
setOutlineWidth (value: number): void {
Expand All @@ -201,7 +200,7 @@ export class TextItem extends SpriteItem {

/**
* 设置阴影模糊
* @param value 阴影模糊强度
* @param value - 阴影模糊强度
* @returns
*/
setShadowBlur (value: number): void {
Expand All @@ -214,7 +213,7 @@ export class TextItem extends SpriteItem {

/**
* 设置阴影颜色
* @param value 阴影颜色
* @param value - 阴影颜色
* @returns
*/
setShadowColor (value: spec.RGBAColorValue): void {
Expand All @@ -227,7 +226,7 @@ export class TextItem extends SpriteItem {

/**
* 设置阴影水平偏移距离
* @param value 水平偏移距离
* @param value - 水平偏移距离
* @returns
*/
setShadowOffsetX (value: number): void {
Expand All @@ -240,7 +239,7 @@ export class TextItem extends SpriteItem {

/**
* 设置阴影水平偏移距离
* @param value 水平偏移距离
* @param value - 水平偏移距离
* @returns
*/
setShadowOffsetY (value: number): void {
Expand All @@ -253,7 +252,7 @@ export class TextItem extends SpriteItem {

/**
* 设置字体清晰度
* @param value 字体清晰度
* @param value - 字体清晰度
* @returns
*/
setFontScale (value: number): void {
Expand Down Expand Up @@ -434,5 +433,4 @@ export class TextItem extends SpriteItem {
context!.shadowOffsetX = style.shadowOffsetX ;
context!.shadowOffsetY = -style.shadowOffsetY ;
}

}
2 changes: 1 addition & 1 deletion packages/effects-core/src/plugins/text/text-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class TextLoader extends AbstractPlugin {
}

override onCompositionItemRemoved (composition: Composition, item: VFXItem<TextItem>) {
// FIXME: 此处判断有问题,item 应该先判断
if (item instanceof TextVFXItem && item) {
addItem(this.removeItems, item);
if (this.addItems.includes(item)) {
Expand All @@ -76,7 +77,6 @@ export class TextLoader extends AbstractPlugin {
removeItem(this.addItems, item);
item.content.mesh.mesh.dispose({ material: { textures: DestroyOptions.keep } });
item.dispose();

}
});

Expand Down

0 comments on commit 65ad8db

Please sign in to comment.