Skip to content

Commit

Permalink
update: 更新polyline-tool逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan Heng committed Jul 27, 2023
1 parent 0e537af commit a237a2a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/core/src/tools/polyline-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ class PolylineTool implements Tool {
this.points.push(app.pointer);
}
if (this.polyline) {
app.canvas.remove(this.polyline);
this.polyline.set({ points: this.points });
} else {
this.polyline = new PPolyline(this.points, {
fill: 'transparent',
stroke: 'black',
strokeWidth: 2,
});
app.canvas.add(this.polyline);
}
this.polyline = new PPolyline(this.points, {
fill: 'transparent',
stroke: 'black',
strokeWidth: 2,
});
app.canvas.add(this.polyline);
}

public onMouseMove({ app }: AppMouseEvent): void {
Expand Down

0 comments on commit a237a2a

Please sign in to comment.