fix scale issues
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 1m36s

This commit is contained in:
2026-02-09 19:01:08 -05:00
parent b3e7862cc9
commit 8808ed9949

View File

@@ -845,10 +845,17 @@
cropCtx.lineWidth = 3; cropCtx.lineWidth = 3;
cropCtx.strokeRect(x, y, width, height); cropCtx.strokeRect(x, y, width, height);
// Draw dimensions text // Calculate actual video dimensions for display
const video = document.getElementById('video-preview');
const scaleX = videoInfo.width / video.offsetWidth;
const scaleY = videoInfo.height / video.offsetHeight;
const actualWidth = Math.abs(Math.round(width * scaleX));
const actualHeight = Math.abs(Math.round(height * scaleY));
// Draw dimensions text (showing actual video pixels)
cropCtx.fillStyle = '#667eea'; cropCtx.fillStyle = '#667eea';
cropCtx.font = 'bold 14px sans-serif'; cropCtx.font = 'bold 14px sans-serif';
const text = `${Math.abs(Math.round(width))} × ${Math.abs(Math.round(height))}`; const text = `${actualWidth} × ${actualHeight}`;
cropCtx.fillText(text, x + 5, y - 5); cropCtx.fillText(text, x + 5, y - 5);
} }