Skip to content

Commit fb35584

Browse files
committed
Now rounding the computed variables to prevent an error from Electron/Nightmare.
1 parent 503f90a commit fb35584

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-template",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "This library is responsible for expanding a template web page and then capturing it PNG or PDF.",
55
"main": "build/index.js",
66
"types": "build/index.d.ts",

src/web-page-renderer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ export class WebPageRenderer implements IWebPageRenderer {
159159
return {
160160
bodyWidth: body.scrollWidth,
161161
bodyHeight: body.scrollHeight,
162-
x: rect.left,
163-
y: rect.top,
164-
height: rect.bottom - rect.top,
165-
width: rect.right - rect.left,
162+
x: Math.ceil(rect.left),
163+
y: Math.ceil(rect.top),
164+
height: Math.ceil(rect.bottom - rect.top),
165+
width: Math.ceil(rect.right - rect.left),
166166
};
167167
},
168168
options.captureSelector || options.waitSelector,

0 commit comments

Comments
 (0)