From e564e9884c8cdedda71dd5170532692aa93094ae Mon Sep 17 00:00:00 2001 From: gramps Date: Tue, 8 Sep 2026 13:29:22 -0700 Subject: [PATCH] =?UTF-8?q?docs:=20update=20HANDOFF=20+=20MyMistakes.md=20?= =?UTF-8?q?=E2=80=94=20take-24=20PasteKey=20fix=20landed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HANDOFF.md | 19 ++++++------------- MyMistakes.md | 15 +++++++++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/HANDOFF.md b/HANDOFF.md index 5e9b1fb..1afdcb4 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -2,9 +2,10 @@ ## Branch / Commit State -**`main` HEAD = `f6802c7`** — take-23: stride-correct CropBounds Fill rendering. +**`main` HEAD = `081e4c1`** — take-24: PasteKey includes CropBounds — stale raster cache fixed. ``` +081e4c1 fix(web): add CropBounds to PasteKey — stale raster cache was corrupting transparency f6802c7 fix(web): stride-correct CropBounds Fill rendering in compositor (take-23) 84aa70f docs: MyMistakes.md — take-22 full fix for widget scale/position + transparency ed9d7c1 fix(web): CropBounds metadata + Fill-style scaling in compositor — transparent margins preserved, widget fills element rect (BROKEN — reverted) @@ -14,21 +15,13 @@ e002847 fix(web): feed full canvas to compositor — transparent margins reveal 87509bc (origin/main) docs: restructure TASKS.md into a catalog ``` -**Pushed to origin: `87509bc`.** 7 unpushed commits after it. +**Pushed to origin: `87509bc`.** 8 unpushed commits after it. ## Web Overlay — Current State -take-22 (`ed9d7c1`) BROKE the widget — the CropBounds stride was wrong (pixel index used `w = cbW` crop width instead of `src.Width` canvas stride, reading garbage from the full-canvas buffer). REVERTED by the take-23 revert of `ed9d7c1`. - -take-23 (`f6802c7`) is the correct fix: -- `VideoFrame.CropBounds?: (X,Y,W,H)` — metadata on the frame -- `WebView2Manager` sets `CropBounds = (cropX, cropY, cropW, cropH)` on the LatestFrame -- `BlitContentRaw` detects CropBounds and uses Fill-style scaling (stretch to cover, no aspect preservation) using `src.Width` (canvas stride = 1920) for ALL pixel buffer indexing — not the crop width - -## Resolved this session - -- **Audio regression (TASK 26):** Non-event — external headset volume control was at minimum. -- **Web overlay scale/position + transparency:** take-23 at `f6802c7`. The stride fix was critical — take-22 used crop width (e.g., 800) instead of canvas stride (1920) in pixel indexing, reading garbage from the full-canvas buffer and destroying content. +take-22 (`ed9d7c1`) BROKE: stride bug (crop width used for canvas buffer indexing) — REVERTED. +take-23 (`f6802c7`): stride fixed, but PasteKey missing CropBounds → stale raster cached → transparent pixels corrupted to opaque. +take-24 (`081e4c1`): FIX. `PasteKey` now includes `frame.CropBounds`. Different crop bounds = cache miss = fresh raster with correct alpha. ## Still open (needs your run + log) diff --git a/MyMistakes.md b/MyMistakes.md index c465bd3..7689a02 100644 --- a/MyMistakes.md +++ b/MyMistakes.md @@ -32,10 +32,17 @@ widget appeared shrunk and offset. `UniformToFill` used `src=1920×1080` for a 7 by crop width instead of canvas stride computed completely wrong memory offsets — garbage pixels, "original content destroyed." Reverted. -**Take-23 (`f6802c7`): CORRECT FIX.** `BlitContentRaw` CropBounds path now uses `src.Width` -(canvas stride = 1920) for ALL pixel indexing. The Fill-style scale centers the crop content -in the element rect. Transparent margins of the full canvas are preserved and reveal layers -beneath. `srcStride` is explicitly named `srcStride = src.Width` to prevent this mistake recurring. +**Take-23 (`f6802c7`): stride fix.** `BlitContentRaw` CropBounds path uses `src.Width` +(canvas stride = 1920) for ALL pixel indexing. `srcStride` explicitly named to prevent recurrence. + +**Take-24 (`081e4c1`): transparency still broken after scale fix — PasteKey missing CropBounds.** +Scale was correct but transparent pixels showed black (backdrop) instead of revealing webcam. +Root cause: `PasteKey` (compositor paste cache) was keyed on `(Pixels, Epoch, Width, Height, +DstW, DstH, Round, Mirror)` — NOT `CropBounds`. Since the frame Width/Height are always +1920×1080 (the canvas) regardless of crop bounds, the same key was used for all element +sizes. A stale raster (wrong crop) was served from the cache after resize or first add, +baking in opaque content over transparent regions. Fix: add `CropBounds` to `PasteKey`. +`frame.CropBounds` is included in the cache key so different crop bounds = cache miss. ### Shrink / re-encode an image for the README (screenshots → small hero image)