Skip to content

Commit 072a883

Browse files
authored
fix: respect user's choice on Oval background color
Updated comment to clarify the condition for filling the canvas.
1 parent 21a6082 commit 072a883

File tree

1 file changed

+2
-2
lines changed
  • packages/react-liveness/src/components/FaceLivenessDetector/service/utils

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ export function drawLivenessOvalInCanvas({
207207
ctx.restore();
208208
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
209209

210-
// fill the canvas with a transparent rectangle
210+
// fill the canvas with a transparent rectangle if no color is defined
211211
ctx.fillStyle = isStartScreen
212212
? getComputedStyle(canvas).getPropertyValue(
213213
'--amplify-colors-background-primary'
214214
)
215-
: '#fff';
215+
|| '#fff';
216216
ctx.fillRect(0, 0, canvasWidth, canvasHeight);
217217

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

0 commit comments

Comments
 (0)