We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1d0175 commit fc2f55eCopy full SHA for fc2f55e
1 file changed
src/phoenix/shell.js
@@ -209,10 +209,12 @@ async function _capturePageBinary(rectOrNodeOrSelector) {
209
throw new Error("rect width and height must be greater than 0");
210
}
211
const zoomFactor = (window.PhStore && window.PhStore.getItem("desktopZoomScale")) || 1;
212
- if (rect.x + rect.width > window.innerWidth * zoomFactor) {
+ const maxWidth = Math.ceil(window.innerWidth * zoomFactor);
213
+ const maxHeight = Math.ceil(window.innerHeight * zoomFactor);
214
+ if (rect.x + rect.width > maxWidth) {
215
throw new Error("rect x + width exceeds window innerWidth");
216
- if (rect.y + rect.height > window.innerHeight * zoomFactor) {
217
+ if (rect.y + rect.height > maxHeight) {
218
throw new Error("rect y + height exceeds window innerHeight");
219
220
0 commit comments