mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Pass integers to the Emulation.setVisibleSize
Integers are required in the Emulation.setVisibleSize. This patch fixes the screenshot clipRect so that it never tries to pass float values.
This commit is contained in:
@@ -395,8 +395,8 @@ class Page extends EventEmitter {
|
||||
if (clipRect) {
|
||||
await Promise.all([
|
||||
this._client.send('Emulation.setVisibleSize', {
|
||||
width: clipRect.width / this._screenDPI,
|
||||
height: clipRect.height / this._screenDPI,
|
||||
width: Math.ceil(clipRect.width / this._screenDPI),
|
||||
height: Math.ceil(clipRect.height / this._screenDPI),
|
||||
}),
|
||||
this._client.send('Emulation.forceViewport', {
|
||||
x: clipRect.x / this._screenDPI,
|
||||
|
||||
Reference in New Issue
Block a user