Skip to content

Commit ddc1a53

Browse files
authored
Refactor canvas fillStyle assignment for clarity
1 parent 072a883 commit ddc1a53

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

  • packages/react-liveness/src/components/FaceLivenessDetector/service/utils

packages/react-liveness/src/components/FaceLivenessDetector/service/utils/liveness.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,10 @@ export function drawLivenessOvalInCanvas({
208208
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
209209

210210
// fill the canvas with a transparent rectangle if no color is defined
211-
ctx.fillStyle = isStartScreen
212-
? getComputedStyle(canvas).getPropertyValue(
211+
ctx.fillStyle = getComputedStyle(canvas).getPropertyValue(
213212
'--amplify-colors-background-primary'
214-
)
215-
|| '#fff';
213+
) || '#fff';
214+
216215
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
217216

218217
// On mobile our canvas is the width/height of the full screen.

0 commit comments

Comments
 (0)