File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -209,10 +209,12 @@ async function _capturePageBinary(rectOrNodeOrSelector) {
209209 throw new Error ( "rect width and height must be greater than 0" ) ;
210210 }
211211 const zoomFactor = ( window . PhStore && window . PhStore . getItem ( "desktopZoomScale" ) ) || 1 ;
212- if ( rect . x + rect . width > window . innerWidth * zoomFactor ) {
212+ const maxWidth = Math . ceil ( window . innerWidth * zoomFactor ) ;
213+ const maxHeight = Math . ceil ( window . innerHeight * zoomFactor ) ;
214+ if ( rect . x + rect . width > maxWidth ) {
213215 throw new Error ( "rect x + width exceeds window innerWidth" ) ;
214216 }
215- if ( rect . y + rect . height > window . innerHeight * zoomFactor ) {
217+ if ( rect . y + rect . height > maxHeight ) {
216218 throw new Error ( "rect y + height exceeds window innerHeight" ) ;
217219 }
218220 }
You can’t perform that action at this time.
0 commit comments