diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 049f3ea..bcd51b1 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -101,8 +101,6 @@ export class SectionDraw extends GraphicDrawAssistant< prepareData(data: ISectionData): boolean { data.points = this.points; data.code = 'G000'; - console.log(data.points[1].x); - console.log(data.points[0].x); data.childTransforms = [ new ChildTransform( 'label', @@ -400,6 +398,25 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin
{ (p) => new graphicData.Point({ x: p.x, y: p.y }) ); data.id = this.drawAssistant.nextId(); + data.childTransforms = [ + new ChildTransform( + 'label', + new GraphicTransform( + { + x: + data.points[0].x + + (data.points[1].x - data.points[0].x) / 2, + y: + data.points[0].y + + (data.points[1].y - data.points[0].y) / 2 + + 20, + }, + { x: 0, y: 0 }, + 0, + { x: 0, y: 0 } + ) + ), + ]; const g = this.drawAssistant.graphicTemplate.new(); g.loadData(data); this.drawAssistant.storeGraphic(g);