From 8ec8655b2a4d5d64a24c1dab4ba979617cb7577a Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Wed, 27 Dec 2023 11:15:16 -0700 Subject: [PATCH] Rename TWO_PI to twoPi to be consistent with other similar constants --- packages/react-snowfall/src/Snowflake.ts | 4 ++-- packages/react-snowfall/src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-snowfall/src/Snowflake.ts b/packages/react-snowfall/src/Snowflake.ts index 4169e9f..ee3fc40 100644 --- a/packages/react-snowfall/src/Snowflake.ts +++ b/packages/react-snowfall/src/Snowflake.ts @@ -1,5 +1,5 @@ import isEqual from 'react-fast-compare' -import { lerp, random, randomElement, TWO_PI } from './utils.js' +import { lerp, random, randomElement, twoPi } from './utils.js' export interface SnowflakeProps { /** The color of the snowflake, can be any valid CSS color. */ @@ -230,7 +230,7 @@ class Snowflake { */ public drawCircle(ctx: CanvasRenderingContext2D): void { ctx.moveTo(this.params.x, this.params.y) - ctx.arc(this.params.x, this.params.y, this.params.radius, 0, TWO_PI) + ctx.arc(this.params.x, this.params.y, this.params.radius, 0, twoPi) } /** diff --git a/packages/react-snowfall/src/utils.ts b/packages/react-snowfall/src/utils.ts index 6e6168d..b2e89bc 100644 --- a/packages/react-snowfall/src/utils.ts +++ b/packages/react-snowfall/src/utils.ts @@ -53,4 +53,4 @@ export function getSize(element?: HTMLElement | null) { * * This is so we can avoid calculating this value every time we draw a circle. */ -export const TWO_PI = Math.PI * 2 +export const twoPi = Math.PI * 2