Closed shawnbot closed 7 years ago
Capturing elements with non-integer bounding rectangles throws a difficult-to-decipher error in electron, which I eventually traced back to the docs:
Rectangle Object x Number - The x coordinate of the origin of the rectangle (must be an integer) y Number - The y coordinate of the origin of the rectangle (must be an integer) width Number - The width of the rectangle (must be an integer) height Number - The height of the rectangle (must be an integer)
x
y
width
height
Rounding the returned bounds (with Math.floor() on the upper left coordinates and Math.ceil() on the lower right, to prevent clipping) fixes this.
Math.floor()
Math.ceil()
awesome, thanks!
published as v1.4.0
v1.4.0
No problem, cheers!
Capturing elements with non-integer bounding rectangles throws a difficult-to-decipher error in electron, which I eventually traced back to the docs:
Rounding the returned bounds (with
Math.floor()
on the upper left coordinates andMath.ceil()
on the lower right, to prevent clipping) fixes this.