diff --git a/src/components/Map/MapViewer/utils/config/getCanvasIcon.test.ts b/src/components/Map/MapViewer/utils/config/getCanvasIcon.test.ts index 2915ff798523bc300db72a6c0ab88f8cf97a9466..aa5b864020822722db5351f870bb64595382ed2c 100644 --- a/src/components/Map/MapViewer/utils/config/getCanvasIcon.test.ts +++ b/src/components/Map/MapViewer/utils/config/getCanvasIcon.test.ts @@ -1,6 +1,6 @@ /* eslint-disable no-magic-numbers */ import { DEFAULT_FONT_FAMILY } from '@/constants/font'; -import { getCanvas } from '@/utils/canvas/getCanvas'; +import { createCanvas } from '@/utils/canvas/getCanvas'; import { drawNumberOnCanvas, drawPinOnCanvas, @@ -9,7 +9,7 @@ import { } from './getCanvasIcon'; const getContext = (): CanvasRenderingContext2D => { - const canvas = getCanvas({ width: 100, height: 100 }); + const canvas = createCanvas({ width: 100, height: 100 }); return canvas.getContext('2d') as CanvasRenderingContext2D; }; diff --git a/src/components/Map/MapViewer/utils/config/getCanvasIcon.ts b/src/components/Map/MapViewer/utils/config/getCanvasIcon.ts index 7df1b0b0d841644285873ded94ed926855172a14..c377b0efa124b12dc7ad8633e11d3f80cb5d0df0 100644 --- a/src/components/Map/MapViewer/utils/config/getCanvasIcon.ts +++ b/src/components/Map/MapViewer/utils/config/getCanvasIcon.ts @@ -2,7 +2,7 @@ import { PIN_PATH2D, PIN_SIZE } from '@/constants/canvas'; import { HALF, ONE_AND_HALF, QUARTER, THIRD, TWO_AND_HALF } from '@/constants/dividers'; import { DEFAULT_FONT_FAMILY } from '@/constants/font'; import { Point } from '@/types/map'; -import { getCanvas } from '@/utils/canvas/getCanvas'; +import { createCanvas } from '@/utils/canvas/getCanvas'; import { getFontSizeToFit } from '@/utils/canvas/getFontSizeToFit'; const SMALL_TEXT_VALUE = 1; @@ -60,7 +60,7 @@ export const drawNumberOnCanvas = ( }; export const getCanvasIcon = (args: Args): HTMLCanvasElement => { - const canvas = getCanvas(PIN_SIZE); + const canvas = createCanvas(PIN_SIZE); const ctx = canvas.getContext('2d'); if (!ctx) { return canvas; diff --git a/src/utils/canvas/getCanvas.test.ts b/src/utils/canvas/getCanvas.test.ts index fec95f0b4bb123c26b1870f52ba2ea664a96935f..a0f6f1adf1933477f52a1fcc6c1cc29a83d81e99 100644 --- a/src/utils/canvas/getCanvas.test.ts +++ b/src/utils/canvas/getCanvas.test.ts @@ -1,9 +1,9 @@ /* eslint-disable no-magic-numbers */ -import { getCanvas } from './getCanvas'; +import { createCanvas } from './getCanvas'; describe('getCanvas', () => { it('should return HTMLCanvasElement with valid size on positive params', () => { - const result = getCanvas({ + const result = createCanvas({ width: 800, height: 600, }); diff --git a/src/utils/canvas/getCanvas.ts b/src/utils/canvas/getCanvas.ts index 390bba041a91febfdbf7945eb97c0be8ac4bdb80..d380a465fefe0d70028ff2a7954df241885fe817 100644 --- a/src/utils/canvas/getCanvas.ts +++ b/src/utils/canvas/getCanvas.ts @@ -1,4 +1,4 @@ -export const getCanvas = ({ +export const createCanvas = ({ width, height, }: { diff --git a/src/utils/canvas/getFontSizeToFit.test.ts b/src/utils/canvas/getFontSizeToFit.test.ts index 3f5dea7b36562ee201d3f0de4fef44161f71e3dd..ce53c089ce648a8de13c4b3f885c250731d79161 100644 --- a/src/utils/canvas/getFontSizeToFit.test.ts +++ b/src/utils/canvas/getFontSizeToFit.test.ts @@ -1,9 +1,9 @@ /* eslint-disable no-magic-numbers */ -import { getCanvas } from './getCanvas'; +import { createCanvas } from './getCanvas'; import { getFontSizeToFit } from './getFontSizeToFit'; const getContext = (): CanvasRenderingContext2D => { - const canvas = getCanvas({ width: 100, height: 100 }); + const canvas = createCanvas({ width: 100, height: 100 }); return canvas.getContext('2d') as CanvasRenderingContext2D; };