From 53a4b494ee72cfa3c86965ef591726bc7056c450 Mon Sep 17 00:00:00 2001 From: tbo47 Date: Thu, 27 Mar 2025 10:16:05 +0000 Subject: [PATCH] better let const var variable --- src/shapes/Line.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/shapes/Line.ts b/src/shapes/Line.ts index 664fc3d5..f41e762d 100644 --- a/src/shapes/Line.ts +++ b/src/shapes/Line.ts @@ -102,26 +102,24 @@ export class Line< } _sceneFunc(context: Context) { - let points = this.points(), + const points = this.points(), length = points.length, tension = this.tension(), closed = this.closed(), - bezier = this.bezier(), - tp, - len, - n; + bezier = this.bezier(); if (!length) { return; } + let n = 0; context.beginPath(); context.moveTo(points[0], points[1]); // tension if (tension !== 0 && length > 4) { - tp = this.getTensionPoints(); - len = tp.length; + const tp = this.getTensionPoints(); + const len = tp.length; n = closed ? 0 : 4; if (!closed) {