Skip to content

Commit

Permalink
fix: PointTool is not allowed drawing outside the target when 'drawOu…
Browse files Browse the repository at this point in the history
…tsideTarget' config is false
  • Loading branch information
liuyong1_vendor committed May 24, 2022
1 parent 0a71e02 commit 2668cd7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/lb-annotation/src/core/toolOperation/pointOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,17 @@ class PointOperation extends BasicToolOperation {
? AxisUtils.getOriginCoordinateWithOffsetCoordinate(this.coord, this.zoom, this.currentPos) // 正常的坐标
: AxisUtils.changePointByZoom(zoomCoordinate, 1 / this.zoom); // 恢复正常的坐标

// 边缘判断
if (this.drawOutsideTarget === false) {
if (
this.dependToolName === EToolName.Polygon &&
this.basicResult?.pointList?.length > 0 &&
!PolygonUtils.isInPolygon(coordinate, this.basicResult.pointList)
) {
return;
}
}

this.pointList.forEach((point) => {
if (point.id === this.selectedID) {
point.x = coordinate.x;
Expand Down

0 comments on commit 2668cd7

Please sign in to comment.