同步框架

This commit is contained in:
joylink_zhaoerwei 2023-09-18 17:40:41 +08:00
parent fc619890fe
commit 1ac416e7a4
2 changed files with 9 additions and 9 deletions

View File

@ -523,8 +523,12 @@ export class JlDrawApp extends GraphicApp implements IDrawApp {
*/ */
bindFormData(form: GraphicData): void { bindFormData(form: GraphicData): void {
this.formData = form; this.formData = form;
if (this.selectedGraphics.length == 1) { if (this.formData && this.selectedGraphics.length == 1) {
if (this.formData.graphicType == this.selectedGraphics[0].type) {
this.formData.copyFrom(this.selectedGraphics[0].saveData()); this.formData.copyFrom(this.selectedGraphics[0].saveData());
} else {
this.formData = undefined;
}
} }
} }

View File

@ -4,11 +4,7 @@ import {
FederatedPointerEvent, FederatedPointerEvent,
Point, Point,
} from 'pixi.js'; } from 'pixi.js';
import { import { IGraphicAppConfig, IGraphicScene } from '../app/JlGraphicApp';
IGraphicApp,
IGraphicAppConfig,
IGraphicScene,
} from '../app/JlGraphicApp';
import { JlGraphic } from '../core/JlGraphic'; import { JlGraphic } from '../core/JlGraphic';
export enum InteractionPluginType { export enum InteractionPluginType {
@ -417,10 +413,10 @@ export abstract class GraphicInteractionPlugin<G extends JlGraphic>
implements InteractionPlugin implements InteractionPlugin
{ {
readonly _type = InteractionPluginType.Graphic; readonly _type = InteractionPluginType.Graphic;
app: IGraphicApp; app: IGraphicScene;
name: string; // 唯一标识 name: string; // 唯一标识
_pause: boolean; _pause: boolean;
constructor(name: string, app: IGraphicApp) { constructor(name: string, app: IGraphicScene) {
this.app = app; this.app = app;
this.name = name; this.name = name;
this._pause = true; this._pause = true;