Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: fix issue of animation state\n\n",
"type": "none",
"packageName": "@visactor/vrender-core"
}
],
"packageName": "@visactor/vrender-core",
"email": "lixuef1313@163.com"
}
19 changes: 11 additions & 8 deletions packages/vrender-core/src/graphic/graphic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,29 +259,29 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
declare y1WithoutTransform?: number;

// aabbBounds,所有图形都需要有,所以初始化即赋值
declare protected _AABBBounds: IAABBBounds;
protected declare _AABBBounds: IAABBBounds;
get AABBBounds(): IAABBBounds {
return this.tryUpdateAABBBounds();
}
// 具有旋转的包围盒,部分图元需要,动态初始化
declare protected _OBBBounds?: IOBBBounds;
protected declare _OBBBounds?: IOBBBounds;
get OBBBounds(): IOBBBounds {
return this.tryUpdateOBBBounds();
}
declare protected _globalAABBBounds: IAABBBounds;
protected declare _globalAABBBounds: IAABBBounds;
// 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds
get globalAABBBounds(): IAABBBounds {
return this.tryUpdateGlobalAABBBounds();
}
declare protected _transMatrix: Matrix;
protected declare _transMatrix: Matrix;
get transMatrix(): Matrix {
return this.tryUpdateLocalTransMatrix(true);
}
declare protected _globalTransMatrix: Matrix;
protected declare _globalTransMatrix: Matrix;
get globalTransMatrix(): Matrix {
return this.tryUpdateGlobalTransMatrix(true);
}
declare protected _updateTag: number;
protected declare _updateTag: number;

// 上次更新的stamp
declare stamp?: number;
Expand Down Expand Up @@ -1046,7 +1046,10 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
// (animate as any).stateNames = stateNames;
// animate.to(animateAttrs, stateAnimateConfig.duration, stateAnimateConfig.easing);
noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });
// Object.assign((this as any).finalAttribute, attrs);
// 应用状态的时候要更新 finalAttribute 也就是目标属性
if ((this as any).finalAttribute) {
Object.assign((this as any).finalAttribute, attrs);
}
} else {
this.stopStateAnimates();
this.setAttributesAndPreventAnimate(attrs, false, { type: AttributeUpdateType.STATE });
Expand Down Expand Up @@ -1095,7 +1098,7 @@ export abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGr
private getNormalAttribute(key: string) {
const value = (this.attribute as any)[key];

if (this.animates) {
if (this.animates && this.animates.size) {
// this.animates.forEach(animate => {
// if ((animate as any).stateNames) {
// const endProps = animate.getEndProps();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,11 @@ export class EditModule {
this.textAreaDom.removeEventListener('input', this.handleInput);
this.textAreaDom.removeEventListener('compositionstart', this.handleCompositionStart);
this.textAreaDom.removeEventListener('compositionend', this.handleCompositionEnd);
this.textAreaDom.addEventListener('focusin', this.handleFocusOut);
this.textAreaDom.addEventListener('focusout', this.handleFocusOut);
this.textAreaDom.removeEventListener('focusin', this.handleFocusOut);
this.textAreaDom.removeEventListener('focusout', this.handleFocusOut);
application.global.removeEventListener('keydown', this.handleKeyDown);

this.textAreaDom.parentElement?.removeChild(this.textAreaDom);
this.textAreaDom = null;
}
}
Loading