Skip to content

Visualize Your Ideas With Code

fix(2d): fix Line cache (#232)

Jacoba953b64540c0
diff --git a/packages/2d/src/components/Line.ts b/packages/2d/src/components/Line.ts
index e066d3c4..e06a7006 100644
--- a/packages/2d/src/components/Line.ts
+++ b/packages/2d/src/components/Line.ts
@@ -229,7 +229,7 @@ export class Line extends Shape {
const rect = this.childrenRect();
const arrowSize = this.arrowSize();
const lineWidth = this.lineWidth();
- return rect.expand(Math.max(0, arrowSize - lineWidth / 2));
+ return rect.expand(Math.max(0, arrowSize, lineWidth / 2));
}
protected override drawShape(context: CanvasRenderingContext2D) {