From 3b96cb35df8b1ba162fccd5cd4b80d0a5492193c Mon Sep 17 00:00:00 2001 From: sevk Date: Fri, 27 Oct 2017 14:35:39 +0800 Subject: [PATCH] fix crop location.x fix crop location.x --- lib/watir/extensions/element/screenshot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/watir/extensions/element/screenshot.rb b/lib/watir/extensions/element/screenshot.rb index 778b6a9..8393d51 100644 --- a/lib/watir/extensions/element/screenshot.rb +++ b/lib/watir/extensions/element/screenshot.rb @@ -8,7 +8,7 @@ def screenshot(dest) begin browser.screenshot.save(file) image = ChunkyPNG::Image.from_file(file) - image.crop!(wd.location.x.to_i + 1, wd.location.y.to_i + 1, wd.size.width, wd.size.height) + image.crop!(wd.location.x.to_i , wd.location.y.to_i , wd.size.width, wd.size.height) image.save(dest) ensure file.unlink