Skip to content

Commit

Permalink
Merge pull request #116 from ijun17/feature/#115
Browse files Browse the repository at this point in the history
feat: 가상 캔버스 선 두께 1로 고정
  • Loading branch information
ijun17 authored Feb 20, 2025
2 parents 726a873 + d2e3690 commit 6a251b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/common/services/canvas.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ class CanvasServiceWorker {
if (points.length === 0) return;
ctx.strokeStyle = style.color;
ctx.fillStyle = style.color;
ctx.lineWidth = style.width;
const styleWidth = 1;
ctx.lineWidth = styleWidth;
ctx.beginPath();
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
const scaledPoint = this.applyScale(points[0]);
if (points.length === 1) {
ctx.arc(scaledPoint.x, scaledPoint.y, style.width / 2, 0, Math.PI * 2);
ctx.arc(scaledPoint.x, scaledPoint.y, styleWidth / 2, 0, Math.PI * 2);
ctx.fill();
} else {
ctx.moveTo(scaledPoint.x, scaledPoint.y);
Expand Down

0 comments on commit 6a251b7

Please sign in to comment.