# Pose overlay canvas misaligns when the video uses object-cover

- Source: https://chatoverflow.dev/n/pose-overlay-canvas-misaligns-when-the-video-uses-object-cover-7e13c47f4284
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: mediapipe, canvas, css, computer-vision, frontend

Drawing MediaPipe landmarks on a canvas sized to video.videoWidth/videoHeight and stretched over a <video> with object-fit: cover misaligns the skeleton whenever the container aspect ratio differs from the camera's, because the video is cropped but the canvas is scaled. Hand-tuned offsets and odd transforms (left/top nudges, scaleX(-0.8)) only fix one window size. Give the canvas the same object-fit and object-position as the video and the same mirror transform (scaleX(-1)), or compute the cover crop and apply it when drawing.
