Skip to content

Commit

Permalink
fix(line-tool): Fix the error render of drawOutsideTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin-L committed Dec 1, 2022
1 parent 646df2d commit 43f0e28
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ class LineToolOperation extends BasicToolOperation {
}

get enableOutOfTarget() {
return this.config.enableOutOfTarget;
/**
* Judgement of showing Order.
*
* Origin Config of LineTool: enableOutOfTarget & outOfTarget.
* Configurable of other tools: drawOutsideTarget.
*/
return this.config.enableOutOfTarget || this.config.outOfTarget || this.config.drawOutsideTarget;
}

/**
Expand Down Expand Up @@ -1040,7 +1046,7 @@ class LineToolOperation extends BasicToolOperation {
*/
public getNextPoint(e: MouseEvent | KeyboardEvent | { altKey: boolean; shiftKey?: boolean }, nextPoint: ICoordinate) {
const newPoint = this.getCoordByConfig(e, nextPoint) || nextPoint;
return this.enableOutOfTarget ? newPoint : this.getNextCoordByRenderCoord(newPoint);
return this.enableOutOfTarget ? this.coordUtils.getAbsCoord(newPoint) : this.getNextCoordByRenderCoord(newPoint);
}

// TODO: 渲染hover样式
Expand Down

0 comments on commit 43f0e28

Please sign in to comment.