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:
Andrey Lushnikov 2017-06-16 15:43:09 -07:00
parent 25e0bac461
commit 6bed8c62b3

View File

@ -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,