diff --git a/resources/views/fields/camera-capture.blade.php b/resources/views/fields/camera-capture.blade.php index d63441e..51a9f26 100644 --- a/resources/views/fields/camera-capture.blade.php +++ b/resources/views/fields/camera-capture.blade.php @@ -996,18 +996,23 @@ function cameraCapture() { await new Promise(resolve => { this.$refs.video.onloadedmetadata = resolve; }); - - // ✅ Sync overlay canvas size with video size const video = this.$refs.video; const overlay = this.$refs.overlay; overlay.width = video.videoWidth; overlay.height = video.videoHeight; + + // Clear old green boxes + const ctx = overlay.getContext('2d'); + ctx.clearRect(0, 0, overlay.width, overlay.height); + + // Make overlay visible if hidden + overlay.classList.remove('hidden'); this.startDetection(); }, startDetection() { if (this.textDetectionInterval) clearInterval(this.textDetectionInterval); - this.textDetectionInterval = setInterval(() => this.detectText(), 700); + this.textDetectionInterval = setInterval(() => this.detectText(), 500); }, stopDetection() {