Skip to content

Commit c15f4c1

Browse files
fix(screenshot): recognise clip options
fixes #5208 STENCIL-1093
1 parent af6e45b commit c15f4c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/screenshot/screenshot-compare.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,11 @@ export async function compareScreenshot(
104104
// compare the two images pixel by pixel to
105105
// figure out a mismatch value
106106

107-
// figure out the actual width and height of the screenshot
108-
const naturalWidth = Math.round(emulateConfig.viewport.width * emulateConfig.viewport.deviceScaleFactor);
109-
const naturalHeight = Math.round(emulateConfig.viewport.height * emulateConfig.viewport.deviceScaleFactor);
110-
111107
const pixelMatchInput: d.PixelMatchInput = {
112108
imageAPath: join(screenshotBuildData.imagesDir, screenshot.diff.imageA),
113109
imageBPath: join(screenshotBuildData.imagesDir, screenshot.diff.imageB),
114-
width: naturalWidth,
115-
height: naturalHeight,
110+
width,
111+
height,
116112
pixelmatchThreshold: pixelmatchThreshold,
117113
};
118114

0 commit comments

Comments
 (0)