Skip to content

Commit 899504f

Browse files
fix export mouse overlay
1 parent 6a6caf6 commit 899504f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/lib/exporter/frameRenderer.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,19 @@ export class FrameRenderer {
627627
this.maskGraphics.roundRect(0, 0, screenRect.width, screenRect.height, scaledBorderRadius);
628628
this.maskGraphics.fill({ color: 0xffffff });
629629

630-
// Cache layout info
630+
// Cache layout info. baseOffset is the stage position of the FULL
631+
// (uncropped) video sprite's top-left — matches preview semantics so
632+
// downstream consumers (e.g. cursor highlight) can map normalized
633+
// recording-space coordinates to stage coordinates uniformly:
634+
// stagePos = baseOffset + (cx, cy) * (videoWidth, videoHeight) * baseScale
631635
this.layoutCache = {
632636
stageSize: { width, height },
633637
videoSize: { width: croppedVideoWidth, height: croppedVideoHeight },
634638
baseScale: scale,
635-
baseOffset: { x: compositeLayout.screenRect.x, y: compositeLayout.screenRect.y },
639+
baseOffset: {
640+
x: compositeLayout.screenRect.x + coverOffsetX - cropPixelX,
641+
y: compositeLayout.screenRect.y + coverOffsetY - cropPixelY,
642+
},
636643
maskRect: compositeLayout.screenRect,
637644
webcamRect: compositeLayout.webcamRect,
638645
};

0 commit comments

Comments
 (0)