-
setShowConfirmation(false)}
- canBeClosed={false}
- >
- handleConfirmation(true)}
- onNo={() => handleConfirmation(false)}
- />
-
- {(!showConfirmation && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
+
+ {(highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ?
{
onCreateRef={setCanvasReference}
width={width}
height={height}
- isClickConfirmed={isClickConfirmed}
- resetClickConfirmation={() => setIsClickConfirmed(false)}
+ highlighterData={highlighterData}
/>
);
};
const drawImage = (image: string, canvas: HTMLCanvasElement): void => {
-
const ctx = canvas.getContext('2d');
-
const img = new Image();
-
img.src = image;
img.onload = () => {
URL.revokeObjectURL(img.src);
ctx?.drawImage(img, 0, 0, 1280, 720);
- //console.log('Image drawn on canvas:', img.width, img.height);
- //console.log('Image drawn on canvas:', canvas.width, canvas.height);
};
-
};
\ No newline at end of file