Skip to content

Commit b23c08e

Browse files
committed
fix(nc): beginning datum line
1 parent 3896190 commit b23c08e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/renderer/lib/nc/parser/parser.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -844,12 +844,19 @@ export class NCToShapesVisitor extends BaseCstVisitor {
844844
if (ctx.arcCenter) this.visit(ctx.arcCenter)
845845
if (ctx.arcRadius) this.visit(ctx.arcRadius)
846846
if (this.state.mode == Constants.DRILL) {
847-
this.result.push(new Shapes.DatumLine({
848-
xs: this.state.previousX,
849-
ys: this.state.previousY,
850-
xe: this.state.x,
851-
ye: this.state.y,
852-
}))
847+
if (this.result.length > 0) {
848+
this.result.push(new Shapes.DatumLine({
849+
xs: this.state.previousX,
850+
ys: this.state.previousY,
851+
xe: this.state.x,
852+
ye: this.state.y,
853+
}))
854+
} else {
855+
this.result.push(new Shapes.DatumPoint({
856+
x: this.state.x,
857+
y: this.state.y,
858+
}))
859+
}
853860
this.result.push(new Shapes.DatumText({
854861
x: this.state.x,
855862
y: this.state.y,

0 commit comments

Comments
 (0)