Closed Liiva closed 8 years ago
I was getting weird behaviour while trying to capture some screenshots.
It turned out the WebDriver element was returning a float value: wd x location: 362 wd y location: 202.5 <-- issue here wd size width: 940 wd size height: 562
Changing line #11 in https://github.com/ansoni/watir-extensions-element-screenshot/blob/master/lib/watir/extensions/element/screenshot.rb to: image.crop!((wd.location.x + 1).round, (wd.location.y + 1).round, wd.size.width, wd.size.height) Fixed it for me.
I was getting weird behaviour while trying to capture some screenshots.
It turned out the WebDriver element was returning a float value: wd x location: 362 wd y location: 202.5 <-- issue here wd size width: 940 wd size height: 562
Changing line #11 in https://github.com/ansoni/watir-extensions-element-screenshot/blob/master/lib/watir/extensions/element/screenshot.rb to: image.crop!((wd.location.x + 1).round, (wd.location.y + 1).round, wd.size.width, wd.size.height) Fixed it for me.