diff --git a/src/jl-graphic/app/JlDrawApp.ts b/src/jl-graphic/app/JlDrawApp.ts index 25ef784..78040c7 100644 --- a/src/jl-graphic/app/JlDrawApp.ts +++ b/src/jl-graphic/app/JlDrawApp.ts @@ -523,8 +523,12 @@ export class JlDrawApp extends GraphicApp implements IDrawApp { */ bindFormData(form: GraphicData): void { this.formData = form; - if (this.selectedGraphics.length == 1) { - this.formData.copyFrom(this.selectedGraphics[0].saveData()); + if (this.formData && this.selectedGraphics.length == 1) { + if (this.formData.graphicType == this.selectedGraphics[0].type) { + this.formData.copyFrom(this.selectedGraphics[0].saveData()); + } else { + this.formData = undefined; + } } } diff --git a/src/jl-graphic/plugins/InteractionPlugin.ts b/src/jl-graphic/plugins/InteractionPlugin.ts index 080f879..23e2210 100644 --- a/src/jl-graphic/plugins/InteractionPlugin.ts +++ b/src/jl-graphic/plugins/InteractionPlugin.ts @@ -4,11 +4,7 @@ import { FederatedPointerEvent, Point, } from 'pixi.js'; -import { - IGraphicApp, - IGraphicAppConfig, - IGraphicScene, -} from '../app/JlGraphicApp'; +import { IGraphicAppConfig, IGraphicScene } from '../app/JlGraphicApp'; import { JlGraphic } from '../core/JlGraphic'; export enum InteractionPluginType { @@ -417,10 +413,10 @@ export abstract class GraphicInteractionPlugin implements InteractionPlugin { readonly _type = InteractionPluginType.Graphic; - app: IGraphicApp; + app: IGraphicScene; name: string; // 唯一标识 _pause: boolean; - constructor(name: string, app: IGraphicApp) { + constructor(name: string, app: IGraphicScene) { this.app = app; this.name = name; this._pause = true;