lib/capybara/screenshot/diff/browser_helpers.rb in capybara-screenshot-diff-1.8.3 vs lib/capybara/screenshot/diff/browser_helpers.rb in capybara-screenshot-diff-1.9.0
- old
+ new
@@ -81,10 +81,10 @@
def self.all_visible_regions_for(selector)
BrowserHelpers.session.all(selector, visible: true).map(&method(:region_for))
end
def self.region_for(element)
- element.evaluate_script(GET_BOUNDING_CLIENT_RECT_SCRIPT).map { |point| point.negative? ? 0 : point.to_i }
+ element.evaluate_script(GET_BOUNDING_CLIENT_RECT_SCRIPT).map { |point| point.negative? ? 0 : point.ceil.to_i }
end
def self.session
Capybara.current_session
end