Skip to content

end to end app store screenshot creation using AI

fix(template): size rounded magnifier corners from the lens's shorter side

Parth Jadhavedc42f6aa66d
diff --git a/skills/app-store-screenshots/template/src/components/editor/scene-layers.tsx b/skills/app-store-screenshots/template/src/components/editor/scene-layers.tsx
index 3c0fe12..b7925ad 100644
--- a/skills/app-store-screenshots/template/src/components/editor/scene-layers.tsx
+++ b/skills/app-store-screenshots/template/src/components/editor/scene-layers.tsx
@@ -363,12 +363,14 @@ export function DeviceDepth({
/**
* A loupe showing part of the screenshot at `zoom`× the size it appears on the
- * device. `screenWidth` is the device's on-canvas screen width in canvas px.
+ * device. `screenWidth` is the device's on-canvas screen width in canvas px;
+ * `shortSide` is the lens's shorter side in canvas px.
*/
export function CalloutLoupe({
callout,
src,
screenWidth,
+ shortSide,
cW,
accent,
hideEmpty,
@@ -376,6 +378,7 @@ export function CalloutLoupe({
callout: Callout;
src: string;
screenWidth: number;
+ shortSide: number;
cW: number;
accent: string;
hideEmpty?: boolean;
@@ -383,8 +386,9 @@ export function CalloutLoupe({
const resolved = img(src);
const border = Math.max(3, cW * 0.009);
// A % radius resolves against width and height separately, so a wide lens
- // got stretched elliptical corners. A canvas-relative px radius stays round.
- const radius = callout.shape === "circle" ? "50%" : `${cW * 0.035}px`;
+ // got stretched elliptical corners. A px radius from the shorter side stays
+ // round and matches the old 14% on a square lens.
+ const radius = callout.shape === "circle" ? "50%" : `${shortSide * 0.14}px`;
// An export without a screenshot shouldn't ship an empty lens.
if (!resolved && hideEmpty) return null;
return (
diff --git a/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx b/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx
index d80366d..88e8822 100644
--- a/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx
+++ b/skills/app-store-screenshots/template/src/components/editor/slide-canvas.tsx
@@ -1424,6 +1424,7 @@ function SlideElements({
callout={callout}
src={screenshot}
screenWidth={deviceWidth * SCREEN_WIDTH_FRACTION}
+ shortSide={Math.min(rect.width, rect.height)}
cW={cW}
accent={theme.accent}
hideEmpty={hideEmpty}