sectionLink编号颜色&拖动调整

This commit is contained in:
fan 2023-07-12 16:40:23 +08:00
parent 072b44be90
commit 8b763fa671
2 changed files with 10 additions and 2 deletions

View File

@ -50,7 +50,7 @@ export class SectionLink extends JlGraphic implements ILineGraphic {
this.labelGraphic = new VectorText();
this.labelGraphic.setVectorFontSize(14);
this.labelGraphic.anchor.set(0.5);
this.labelGraphic.style.fill = '#0f0';
this.labelGraphic.style.fill = '#ff0';
this.labelGraphic.transformSave = true;
this.labelGraphic.name = 'label';
this.transformSave = true;

View File

@ -464,8 +464,16 @@ export class SectionLinkEditPlugin extends GraphicInteractionPlugin<SectionLink>
g.lineGraphic.eventMode = 'static';
g.lineGraphic.cursor = 'pointer';
g.lineGraphic.hitArea = new SectionLinkGraphicHitArea(g);
g.transformSave = true;
g.labelGraphic.eventMode = 'static';
g.labelGraphic.cursor = 'pointer';
g.labelGraphic.selectable = true;
g.labelGraphic.draggable = true;
}
unbind(g: SectionLink): void {
// console.log
g.transformSave = false;
g.labelGraphic.eventMode = 'none';
g.labelGraphic.selectable = false;
g.labelGraphic.draggable = false;
}
}