Skip to content

Commit

Permalink
fix(screenshot): recognise clip options (#5205)
Browse files Browse the repository at this point in the history
* fix(screenshot): recognise clip options

fixes #5208
STENCIL-1093

* round values
  • Loading branch information
christian-bromann authored Jan 16, 2024
1 parent 32e6599 commit 0d61a53
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/screenshot/screenshot-compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,11 @@ export async function compareScreenshot(
// compare the two images pixel by pixel to
// figure out a mismatch value

// figure out the actual width and height of the screenshot
const naturalWidth = Math.round(emulateConfig.viewport.width * emulateConfig.viewport.deviceScaleFactor);
const naturalHeight = Math.round(emulateConfig.viewport.height * emulateConfig.viewport.deviceScaleFactor);

const pixelMatchInput: d.PixelMatchInput = {
imageAPath: join(screenshotBuildData.imagesDir, screenshot.diff.imageA),
imageBPath: join(screenshotBuildData.imagesDir, screenshot.diff.imageB),
width: naturalWidth,
height: naturalHeight,
width: Math.round(width),
height: Math.round(height),
pixelmatchThreshold: pixelmatchThreshold,
};

Expand Down

0 comments on commit 0d61a53

Please sign in to comment.