From 899504f8e2090fe6d14f647e4f7154da36cfbd2e Mon Sep 17 00:00:00 2001 From: Siddharth Date: Tue, 5 May 2026 22:02:21 -0700 Subject: [PATCH] fix export mouse overlay --- src/lib/exporter/frameRenderer.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/exporter/frameRenderer.ts b/src/lib/exporter/frameRenderer.ts index 5906c70..1e5138c 100644 --- a/src/lib/exporter/frameRenderer.ts +++ b/src/lib/exporter/frameRenderer.ts @@ -627,12 +627,19 @@ export class FrameRenderer { this.maskGraphics.roundRect(0, 0, screenRect.width, screenRect.height, scaledBorderRadius); this.maskGraphics.fill({ color: 0xffffff }); - // Cache layout info + // Cache layout info. baseOffset is the stage position of the FULL + // (uncropped) video sprite's top-left — matches preview semantics so + // downstream consumers (e.g. cursor highlight) can map normalized + // recording-space coordinates to stage coordinates uniformly: + // stagePos = baseOffset + (cx, cy) * (videoWidth, videoHeight) * baseScale this.layoutCache = { stageSize: { width, height }, videoSize: { width: croppedVideoWidth, height: croppedVideoHeight }, baseScale: scale, - baseOffset: { x: compositeLayout.screenRect.x, y: compositeLayout.screenRect.y }, + baseOffset: { + x: compositeLayout.screenRect.x + coverOffsetX - cropPixelX, + y: compositeLayout.screenRect.y + coverOffsetY - cropPixelY, + }, maskRect: compositeLayout.screenRect, webcamRect: compositeLayout.webcamRect, };