Skip to content

Commit

Permalink
feat(animate): 当前后两个动画不冲突时,可以同时进行
Browse files Browse the repository at this point in the history
  • Loading branch information
leaferjs committed Jan 9, 2025
1 parent 6bd06a0 commit 7e17547
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/display/src/UI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export class UI extends Leaf implements IUI { // tip: rewrited Box
return Plugin.need('animate')
}

public killAnimate(_type?: IAnimateType, _killStyle?: IUIInputData): void { }
public killAnimate(_type?: IAnimateType, _nextStyle?: IUIInputData): void { }


// create
Expand Down
8 changes: 7 additions & 1 deletion packages/interface/src/IAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export interface IAnimateEventFunction {

export interface IAnimate extends IAnimateOptions, IEventer {
target: IUI | IObject
list?: IAnimate[] // AnimateList 专用

keyframes: IKeyframe[]
config?: IAnimateOptions
Expand Down Expand Up @@ -172,5 +171,12 @@ export interface IAnimate extends IAnimateOptions, IEventer {
seek(time: number | IPercentData): void
kill(complete?: boolean, killStyle?: IUIInputData): void



destroy(complete?: boolean): void
}

export interface IAnimateList extends IAnimate {
list: IAnimate[]
updateList(animation?: IAnimation[] | IAnimate[], isTemp?: boolean): void
}
2 changes: 1 addition & 1 deletion packages/interface/src/IUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export interface IUI extends IUIAttrData, IFillAttrData, IStrokeAttrData, ICorne
__drawContent?(canvas: ILeaferCanvas, options: IRenderOptions): void

animate(keyframe?: IUIInputData | IKeyframe[] | IAnimation | IAnimation[], options?: ITransition, type?: IAnimateType, isTemp?: boolean): IAnimate
killAnimate(type?: IAnimateType, killStyle?: IUIInputData): void
killAnimate(type?: IAnimateType, nextStyle?: IUIInputData): void

export(filename: string, options?: IExportOptions | number | boolean): Promise<IExportResult>
clone(data?: IUIInputData): IUI
Expand Down
2 changes: 1 addition & 1 deletion packages/interface/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export { ICornerRadiusString, IStrokeWidthString, IPaintString, IShadowString, I
export { ILeafFill, ILeafPaint, ILeafPaintPatternData, ILeafPaintColor, ILeafStrokePaint, ILeafShadowEffect } from './type/IComputedType'
export { IStrokeAttrData, IStrokeInputData, IStrokeComputedData, ITextStyleAttrData, ITextStyleInputData, ITextStyleComputedData, IEffectAttrData, IEffectInputData, IEffectComputedData } from './ICommonAttr'

export { IAnimation, ITransition, IAnimate, IAnimateType, IKeyframe, IKeyframeId, IAnimateEasing, ICubicBezierEasing, IStepsEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvents, IAnimateEventFunction, ICustomEasingFunction, IAnimateKeyframe, IComputedKeyframe, IStyleAnimation, IKeyframesAnimation, IAnimateOptions } from './IAnimation'
export { IAnimation, ITransition, IAnimate, IAnimateList, IAnimateType, IKeyframe, IKeyframeId, IAnimateEasing, ICubicBezierEasing, IStepsEasing, IAnimateEasingFunction, IAnimateEasingName, IAnimateEnding, IAnimateEvents, IAnimateEventFunction, ICustomEasingFunction, IAnimateKeyframe, IComputedKeyframe, IStyleAnimation, IKeyframesAnimation, IAnimateOptions } from './IAnimation'

export { IUIRenderModule, IRectRenderModule, IImageRenderModule, ITextRenderModule, IGroupRenderModule, IFrameRenderModule } from './module/IUIRender'
export { IUIBoundsModule } from './module/IUIBounds'
Expand Down

0 comments on commit 7e17547

Please sign in to comment.