From 4be3ea82d0007b589040c45ce9813503ded13ccc Mon Sep 17 00:00:00 2001 From: ravirajsinh45 Date: Wed, 5 Aug 2026 16:40:18 +0530 Subject: [PATCH 1/4] fix(web): pin image annotations to the picture, not the letterboxed box MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drawings on images were authored and replayed against the full container box rather than the picture inside it. `use-drawing` sized the Fabric canvas from the parent container, stored that size as `_canvasWidth`/`_canvasHeight`, and `AnnotationOverlay` rescaled by a plain per-axis ratio on display. That rescale is only correct when the display container has the same aspect ratio as the authoring one, so any change of shape (sidebar collapsed vs expanded, a resized window, a compare pane, a share link) both stretched the drawing and moved the picture underneath it. Measured in a browser: a 3:1 image annotated at 25% down the picture in a 900x500 viewer, reopened at 400x700, put the mark at -29% — 54% of the image height adrift and off the picture entirely. Through the new constraint it lands at 25% exactly. Video never had this bug; `VideoFrameConstraint` already fits the overlay to the rendered video box. This is the image counterpart, but it cannot be a copy. `