Skip to content

Commit 2203a19

Browse files
author
Tselote Woldemichael
committed
round corners
1 parent 47c11aa commit 2203a19

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

client/src/playback/Actions.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,21 @@ export const ACTION_DEFINITIONS: Record<schema.Action, typeof Action<ActionUnion
200200
const t = match.getInterpolationFactor()
201201
const bump = Math.sin(t * Math.PI * 8) * 0.03
202202
const half = 0.5 + bump
203+
const radius = 0.08 // corner radius
203204

204205
ctx.save()
205206
ctx.shadowBlur = 12
206207
ctx.shadowColor = src.team.color
207208
ctx.strokeStyle = src.team.color
208209
ctx.globalAlpha = 0.7
209210
ctx.lineWidth = 0.04
210-
ctx.strokeRect(srcCoords.x - half, srcCoords.y - half, half * 2, half * 2)
211+
ctx.beginPath()
212+
ctx.moveTo(srcCoords.x - half + radius, srcCoords.y - half)
213+
ctx.arcTo(srcCoords.x + half, srcCoords.y - half, srcCoords.x + half, srcCoords.y + half, radius)
214+
ctx.arcTo(srcCoords.x + half, srcCoords.y + half, srcCoords.x - half, srcCoords.y + half, radius)
215+
ctx.arcTo(srcCoords.x - half, srcCoords.y + half, srcCoords.x - half, srcCoords.y - half, radius)
216+
ctx.arcTo(srcCoords.x - half, srcCoords.y - half, srcCoords.x + half, srcCoords.y - half, radius)
217+
ctx.stroke()
211218
ctx.restore()
212219
ctx.restore()
213220
}

0 commit comments

Comments
 (0)