diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 680c0410a..314027879 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: run: node common/scripts/install-run-rush.js build --only tag:package - name: Run bug server - working-directory: ./packages/vrender + working-directory: ./tools/bugserver-trigger env: BUG_SERVER_TOKEN: ${{ secrets.BUG_SERVER_TOKEN }} run: node ../../common/scripts/install-run-rushx.js ci diff --git a/packages/vrender/src/graphic/arc.ts b/packages/vrender/src/graphic/arc.ts index 028f190c9..2131fc7d3 100644 --- a/packages/vrender/src/graphic/arc.ts +++ b/packages/vrender/src/graphic/arc.ts @@ -1,7 +1,7 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; import { pi2, sin, epsilon, abs, asin, clampAngleByRadian, isNumber, cos, sqrt } from '@visactor/vutils'; import type { IArc, IArcGraphicAttribute } from '../interface/graphic/arc'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { CustomPath2D } from '../common/custom-path2d'; import { parsePadding } from '../common/utils'; import { getTheme } from './theme'; @@ -45,9 +45,9 @@ const ARC_UPDATE_TAG_KEY = [ export class Arc extends Graphic implements IArc { type: GraphicType = 'arc'; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { cap: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; // static parseCornerRadius(r: IArcGraphicAttribute['cornerRadius']) { @@ -326,6 +326,10 @@ export class Arc extends Graphic implements IArc { clone() { return new Arc({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Arc.NOWORK_ANIMATE_ATTR; + } } // addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY); diff --git a/packages/vrender/src/graphic/arc3d.ts b/packages/vrender/src/graphic/arc3d.ts index 9937207f3..14a0f2c23 100644 --- a/packages/vrender/src/graphic/arc3d.ts +++ b/packages/vrender/src/graphic/arc3d.ts @@ -5,15 +5,15 @@ import { getTheme } from './theme'; import { application } from '../application'; import { parsePadding } from '../common/utils'; import { ARC3D_NUMBER_TYPE } from './constants'; -import { NOWORK_ANIMATE_KEY } from './graphic'; +import { NOWORK_ANIMATE_ATTR } from './graphic'; export class Arc3d extends Arc implements IArc3d { type: GraphicType = 'arc3d'; declare attribute: IArc3dGraphicAttribute; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { cap: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; constructor(params: IArc3dGraphicAttribute) { @@ -43,4 +43,8 @@ export class Arc3d extends Arc implements IArc3d { return this._AABBBounds; } + + getNoWorkAnimateAttr(): Record { + return Arc3d.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/area.ts b/packages/vrender/src/graphic/area.ts index 720605045..4418975e8 100644 --- a/packages/vrender/src/graphic/area.ts +++ b/packages/vrender/src/graphic/area.ts @@ -1,6 +1,6 @@ import type { AABBBounds, OBBBounds, IPointLike } from '@visactor/vutils'; import type { IArea, IAreaCacheItem, IAreaGraphicAttribute } from '../interface'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { CustomPath2D } from '../common/custom-path2d'; import { parsePadding, pointsInterpolation } from '../common/utils'; import { getTheme } from './theme'; @@ -12,10 +12,10 @@ const AREA_UPDATE_TAG_KEY = ['segments', 'points', 'curveType', ...GRAPHIC_UPDAT export class Area extends Graphic implements IArea { type: 'area' = 'area'; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { segments: 1, curveType: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; cache?: IAreaCacheItem; @@ -197,4 +197,8 @@ export class Area extends Graphic implements IArea { clone() { return new Area({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Area.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/circle.ts b/packages/vrender/src/graphic/circle.ts index 267424b31..0bb6f561b 100644 --- a/packages/vrender/src/graphic/circle.ts +++ b/packages/vrender/src/graphic/circle.ts @@ -1,7 +1,7 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; import { transformBounds } from '@visactor/vutils'; import type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { CustomPath2D } from '../common/custom-path2d'; import { parsePadding } from '../common/utils'; import { getTheme } from './theme'; @@ -17,7 +17,7 @@ const CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UP export class Circle extends Graphic implements ICircle { type: 'circle' = 'circle'; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: ICircleGraphicAttribute = { radius: 1 }) { super(params); @@ -101,6 +101,10 @@ export class Circle extends Graphic implements ICircle clone() { return new Circle({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Circle.NOWORK_ANIMATE_ATTR; + } } // addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY); diff --git a/packages/vrender/src/graphic/glyph.ts b/packages/vrender/src/graphic/glyph.ts index df1cd9664..373bb6f7b 100644 --- a/packages/vrender/src/graphic/glyph.ts +++ b/packages/vrender/src/graphic/glyph.ts @@ -1,5 +1,5 @@ import type { AABBBounds, IPointLike, OBBBounds } from '@visactor/vutils'; -import { Graphic, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, NOWORK_ANIMATE_ATTR } from './graphic'; import type { GraphicType, IGraphic, @@ -32,7 +32,7 @@ export class Glyph extends Graphic implements IGlyph { }; protected declare subGraphic: IGraphic[]; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: Partial) { super(params); @@ -239,4 +239,8 @@ export class Glyph extends Graphic implements IGlyph { glyph.setSubGraphic(this.subGraphic.map(g => g.clone())); return glyph; } + + getNoWorkAnimateAttr(): Record { + return Glyph.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/graphic.ts b/packages/vrender/src/graphic/graphic.ts index 3dce3a74e..cd1137b79 100644 --- a/packages/vrender/src/graphic/graphic.ts +++ b/packages/vrender/src/graphic/graphic.ts @@ -111,7 +111,7 @@ const tempConstantAngleKey = ['angle']; const point = new Point(); -export const NOWORK_ANIMATE_KEY = { +export const NOWORK_ANIMATE_ATTR = { strokeSeg: 1, boundsPadding: 2, pickMode: 1, @@ -1395,6 +1395,8 @@ export abstract class Graphic = Partial; + abstract clone(): Graphic; } diff --git a/packages/vrender/src/graphic/group.ts b/packages/vrender/src/graphic/group.ts index 658d96cd7..99990c471 100644 --- a/packages/vrender/src/graphic/group.ts +++ b/packages/vrender/src/graphic/group.ts @@ -12,7 +12,7 @@ import type { GraphicType } from '../interface'; import type { IGroup, IGroupGraphicAttribute } from '../interface/graphic/group'; -import { Graphic, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, NOWORK_ANIMATE_ATTR } from './graphic'; import { getTheme, Theme } from './theme'; import { parsePadding } from '../common/utils'; import { UpdateTag, IContainPointMode } from '../common/enums'; @@ -35,7 +35,7 @@ export class Group extends Graphic implements IGroup { declare theme?: ITheme; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: IGroupGraphicAttribute) { super(params); @@ -374,4 +374,8 @@ export class Group extends Graphic implements IGroup { clone() { return new Group({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Group.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/image.ts b/packages/vrender/src/graphic/image.ts index de1a6283a..48a630f42 100644 --- a/packages/vrender/src/graphic/image.ts +++ b/packages/vrender/src/graphic/image.ts @@ -1,6 +1,6 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; import type { IImage, IImageGraphicAttribute, IRepeatType } from '../interface'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { DefaultImageAttribute } from './config'; import { getTheme } from './theme'; import { application } from '../application'; @@ -19,11 +19,11 @@ export class Image extends Graphic implements IImage { successCallback?: () => void; failCallback?: () => void; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { image: 1, repeatX: 1, repeatY: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; constructor(params: IImageGraphicAttribute) { @@ -146,4 +146,8 @@ export class Image extends Graphic implements IImage { clone() { return new Image({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Image.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/line.ts b/packages/vrender/src/graphic/line.ts index 1db683d0d..2cd4b776c 100644 --- a/packages/vrender/src/graphic/line.ts +++ b/packages/vrender/src/graphic/line.ts @@ -1,6 +1,6 @@ import type { AABBBounds, OBBBounds, IPointLike } from '@visactor/vutils'; import type { ILine, ILineGraphicAttribute } from '../interface'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { getTheme } from './theme'; import { application } from '../application'; import { parsePadding, pointsInterpolation } from '../common/utils'; @@ -17,10 +17,10 @@ export class Line extends Graphic implements ILine { this.numberType = LINE_NUMBER_TYPE; } - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { segments: 1, curveType: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; isValid(): boolean { @@ -134,6 +134,10 @@ export class Line extends Graphic implements ILine { clone() { return new Line({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Line.NOWORK_ANIMATE_ATTR; + } } // addAttributeToPrototype(DefaultLineStyle, Line, PURE_STYLE_KEY); diff --git a/packages/vrender/src/graphic/path.ts b/packages/vrender/src/graphic/path.ts index 05df39971..89efed2c7 100644 --- a/packages/vrender/src/graphic/path.ts +++ b/packages/vrender/src/graphic/path.ts @@ -1,6 +1,6 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; import { isString, isNil } from '@visactor/vutils'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface'; import { parsePadding } from '../common/utils'; import { CustomPath2D } from '../common/custom-path2d'; @@ -14,10 +14,10 @@ export class Path extends Graphic implements IPath { type: 'path' = 'path'; cache?: ICustomPath2D; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { path: 1, customPath: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; constructor(params: IPathGraphicAttribute) { @@ -128,4 +128,8 @@ export class Path extends Graphic implements IPath { clone() { return new Path({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Path.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/polygon.ts b/packages/vrender/src/graphic/polygon.ts index 335864ab7..9c81252ca 100644 --- a/packages/vrender/src/graphic/polygon.ts +++ b/packages/vrender/src/graphic/polygon.ts @@ -1,5 +1,5 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import type { IPolygon, IPolygonGraphicAttribute } from '../interface/graphic/polygon'; import { getTheme } from './theme'; import { parsePadding, pointsInterpolation } from '../common/utils'; @@ -13,7 +13,7 @@ const POLYGON_UPDATE_TAG_KEY = ['points', 'cornerRadius', ...GRAPHIC_UPDATE_TAG_ export class Polygon extends Graphic implements IPolygon { type: GraphicType = 'polygon'; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: IPolygonGraphicAttribute) { super(params); @@ -104,4 +104,8 @@ export class Polygon extends Graphic implements IPolyg clone() { return new Polygon({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Polygon.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/pyramid3d.ts b/packages/vrender/src/graphic/pyramid3d.ts index 8887f3760..10363b0b0 100644 --- a/packages/vrender/src/graphic/pyramid3d.ts +++ b/packages/vrender/src/graphic/pyramid3d.ts @@ -7,13 +7,13 @@ import { application } from '../application'; import { Polygon } from './polygon'; import { getTheme } from './theme'; import { PYRAMID3D_NUMBER_TYPE } from './constants'; -import { NOWORK_ANIMATE_KEY } from './graphic'; +import { NOWORK_ANIMATE_ATTR } from './graphic'; export class Pyramid3d extends Polygon implements IPyramid3d { type: GraphicType = 'pyramid3d'; declare attribute: IPyramid3dGraphicAttribute; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: IPyramid3dGraphicAttribute) { super(params); @@ -134,4 +134,8 @@ export class Pyramid3d extends Polygon implements IPyramid3d { protected _isValid(): boolean { return super._isValid() && this.attribute.points.length === 4; } + + getNoWorkAnimateAttr(): Record { + return Pyramid3d.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/rect.ts b/packages/vrender/src/graphic/rect.ts index 3d2328027..94f6b3da7 100644 --- a/packages/vrender/src/graphic/rect.ts +++ b/packages/vrender/src/graphic/rect.ts @@ -1,5 +1,5 @@ import type { AABBBounds, OBBBounds } from '@visactor/vutils'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import type { GraphicType, IRect, IRectGraphicAttribute } from '../interface'; import { CustomPath2D } from '../common/custom-path2d'; import { parsePadding } from '../common/utils'; @@ -12,7 +12,7 @@ const RECT_UPDATE_TAG_KEY = ['width', 'height', 'cornerRadius', ...GRAPHIC_UPDAT export class Rect extends Graphic implements IRect { type: GraphicType = 'rect'; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: IRectGraphicAttribute) { super(params); @@ -93,4 +93,8 @@ export class Rect extends Graphic implements IRect { clone() { return new Rect({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Rect.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/rect3d.ts b/packages/vrender/src/graphic/rect3d.ts index 555b10bf1..6278be5c4 100644 --- a/packages/vrender/src/graphic/rect3d.ts +++ b/packages/vrender/src/graphic/rect3d.ts @@ -3,7 +3,7 @@ import type { GraphicType, IFace3d, IRect3d, IRect3dGraphicAttribute } from '../ import { Rect } from './rect'; import { getTheme } from './theme'; import { RECT3D_NUMBER_TYPE } from './constants'; -import { NOWORK_ANIMATE_KEY } from './graphic'; +import { NOWORK_ANIMATE_ATTR } from './graphic'; const CUBE_VERTICES = [ [0, 0, 0], @@ -20,7 +20,7 @@ export class Rect3d extends Rect implements IRect3d { type: GraphicType = 'rect3d'; declare attribute: IRect3dGraphicAttribute; - static NOWORK_ANIMATE_KEY = NOWORK_ANIMATE_KEY; + static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR; constructor(params: IRect3dGraphicAttribute) { super(params); @@ -70,4 +70,8 @@ export class Rect3d extends Rect implements IRect3d { return faces; } + + getNoWorkAnimateAttr(): Record { + return Rect3d.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/richtext.ts b/packages/vrender/src/graphic/richtext.ts index 576cd0e07..c3d8dbab7 100644 --- a/packages/vrender/src/graphic/richtext.ts +++ b/packages/vrender/src/graphic/richtext.ts @@ -13,7 +13,7 @@ import type { ILayer, IRichTextIcon } from '../interface'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { DefaultRichTextAttribute } from './config'; import Frame from './richtext/frame'; import Paragraph from './richtext/paragraph'; @@ -46,7 +46,7 @@ export class RichText extends Graphic implements IRic _frameCache: Frame; // 富文本布局画布 _currentHoverIcon: IRichTextIcon | null = null; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { ellipsis: 1, wordBreak: 1, verticalDirection: 1, @@ -54,7 +54,7 @@ export class RichText extends Graphic implements IRic textBaseline: 1, textConfig: 1, layoutDirection: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; constructor(params?: IRichTextGraphicAttribute) { @@ -372,4 +372,8 @@ export class RichText extends Graphic implements IRic return pickIcon; } + + getNoWorkAnimateAttr(): Record { + return RichText.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/graphic/symbol.ts b/packages/vrender/src/graphic/symbol.ts index b247cd8ad..ad5ac228a 100644 --- a/packages/vrender/src/graphic/symbol.ts +++ b/packages/vrender/src/graphic/symbol.ts @@ -3,7 +3,7 @@ import { AABBBounds } from '@visactor/vutils'; import { isArray, max } from '@visactor/vutils'; import type { ISymbol, ISymbolClass, ISymbolGraphicAttribute } from '../interface'; import { builtinSymbolsMap, CustomSymbolClass } from './builtin-symbol'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { parsePadding } from '../common/utils'; import { getTheme } from './theme'; import { application } from '../application'; @@ -21,9 +21,9 @@ export class Symbol extends Graphic implements ISymbol static userSymbolMap: Record = {}; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { symbolType: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; constructor(params: ISymbolGraphicAttribute = { symbolType: 'circle' }) { @@ -183,6 +183,10 @@ export class Symbol extends Graphic implements ISymbol clone() { return new Symbol({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Symbol.NOWORK_ANIMATE_ATTR; + } } // addAttributeToPrototype(DefaultSymbolStyle, Symbol, PURE_STYLE_KEY); diff --git a/packages/vrender/src/graphic/text.ts b/packages/vrender/src/graphic/text.ts index e71d6ee26..22af4abf1 100644 --- a/packages/vrender/src/graphic/text.ts +++ b/packages/vrender/src/graphic/text.ts @@ -3,7 +3,7 @@ import { getContextFont, textDrawOffsetX, textLayoutOffsetY } from '../common/te import { CanvasTextLayout } from '../core/contributions/textMeasure/layout'; import { application } from '../application'; import type { IText, ITextCache, ITextGraphicAttribute, LayoutType } from '../interface'; -import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_KEY } from './graphic'; +import { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic'; import { getTheme } from './theme'; import { parsePadding } from '../common/utils'; import { TEXT_NUMBER_TYPE } from './constants'; @@ -27,7 +27,7 @@ const TEXT_UPDATE_TAG_KEY = [ export class Text extends Graphic implements IText { type: 'text' = 'text'; - static NOWORK_ANIMATE_KEY = { + static NOWORK_ANIMATE_ATTR = { ellipsis: 1, wordBreak: 1, direction: 1, @@ -35,7 +35,7 @@ export class Text extends Graphic implements IText { textBaseline: 1, fontFamily: 1, fontWeight: 1, - ...NOWORK_ANIMATE_KEY + ...NOWORK_ANIMATE_ATTR }; cache: ITextCache; @@ -506,6 +506,10 @@ export class Text extends Graphic implements IText { clone(): Text { return new Text({ ...this.attribute }); } + + getNoWorkAnimateAttr(): Record { + return Text.NOWORK_ANIMATE_ATTR; + } } // addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY); diff --git a/packages/vrender/src/graphic/wrap-text.ts b/packages/vrender/src/graphic/wrap-text.ts index fa49e1f6d..52d75e8b3 100644 --- a/packages/vrender/src/graphic/wrap-text.ts +++ b/packages/vrender/src/graphic/wrap-text.ts @@ -230,4 +230,8 @@ export class WrapText extends Text { } return super.needUpdateTag(key); } + + getNoWorkAnimateAttr(): Record { + return WrapText.NOWORK_ANIMATE_ATTR; + } } diff --git a/packages/vrender/src/interface/graphic.ts b/packages/vrender/src/interface/graphic.ts index 6a64a43f6..0f348a2c9 100644 --- a/packages/vrender/src/interface/graphic.ts +++ b/packages/vrender/src/interface/graphic.ts @@ -412,6 +412,7 @@ export interface IGraphic = Partial IGraphic; stopAnimates: (stopChildren?: boolean) => void; + getNoWorkAnimateAttr: () => Record; } export interface IRoot extends IGraphic {